• Welcome to The Cave of Dragonflies forums, where the smallest bugs live alongside the strongest dragons.

    Guests are not able to post messages or even read certain areas of the forums. Now, that's boring, don't you think? Registration, on the other hand, is simple, completely free of charge, and does not require you to give out any personal information at all. As soon as you register, you can take part in some of the happy fun things at the forums such as posting messages, voting in polls, sending private messages to people and being told that this is where we drink tea and eat cod.

    Of course I'm not forcing you to do anything if you don't want to, but seriously, what have you got to lose? Five seconds of your life?

Coding Evolution

Hiikaru

Run.
Pronoun
he
I want to create a game about things evolving into other things.

Originally the whole piece of art was going to change, but that ended up being upwards of two hundred images and I never made much headway.

Eventually I got the idea that everything could use a set of bases, and then just a few parts would change. Sort of like Evo: Search for Eden, or if you haven't played that, then similar to a dress up game. So if it evolved into a flying type, then for instance wings could appear on the base.

And then why not take it a step further and play mix and match with the parts, since they're already separate from the base?

In this hypothetical game, you adopt this human creature to take care of. Each time you perform a certain action, it adds points to some invisible elemental variable. Also, the character has different "slots" for mutations, for example head, back, and arms. If the elemental variable is high in Air, they'll develop things like wings and feathers in those slots, for Water, fins, etc.

So I'm thinking that all of these mutations would be written in the code, and then when x variable and y variable are high enough, there's a code to make them visible. Also a code to remember what mutations they have when they grow to the next stage, and some kind of cookie thing to remember what your character is like when you come back.

For my last pet game I made a code to replace Eevee with a Pikachu or one of its evolutions depending on what the $Pokemon variable was set to (based on a cookie that existed on some pages), so I think I could hack together a similar system for these mutations, but I'm not sure that's the best way to go about this.

If I did do that, I guess I'd have variables like $head and $back automatically set to transparent images and have them replaced by horns or spikes somehow when the numbers changed.

And I think that that would work, but it sounds sort of weird.

Is there a better way to deal with this project?

Additionally, how can I make it so you can have multiple characters and then switch in between them? I guess the character menu would have slots and pages and then create new characters in the slots and also create new pages when necessary, but I don't really have any experience with writing a code to create new things.

There are other things I want to do with the game, but those are really the key features and I think if I can get them figured out then I can manage about everything else.
 
Alright, here's what I have so far (and this is also used for wings/tail/etc. slots).

Code to show an image based on what the variable is:
<?php $gif = ".jpg height=300 width=400>" ?>
<?php $character = print ("<img src=images/bases/". $character.$gif); ?>

Variable:
<?php
session_start();

if(isset($_SESSION['character']))
$_SESSION['character'] = $_SESSION['character']= $_SESSION['character'];

else
$_SESSION['character'] = babym;
echo "character = ". $_SESSION['character'];
?>

<?php $character=($_SESSION['character']) ?>
<?php $character=($_SESSION['character']) ?>

Change the variable:
<?php
session_start();
$_SESSION['character']=babyf;
?>

...But none of this is new, I already wrote it for the Eevee game.

I wrote a code to add numbers to the variable on refresh when I had this dumb idea that all the Pokemon in my other game would be numbers, but I deleted it for some reason and I can't figure out how to make it again.

So at the moment what I can make is basically a needlessly complicated dress-up where you go to a different page each time you change something.

Still not sure how to attach these variables to some other variables that come up when you feed/play/whatever. Or whether or not there's a better way to do this.
 
Ah, I'm sorry, let's see...

It's about taking care of this creature, and depending on what you do with it, it evolves different ways. So for instance if you feed it, say, lots of curry, then it evolves into a dragon whereas if you feed it lots of fruit it evolves into a raccoon.

So thing number one is that I want to add +1 to some x variable every time I do x. Plus one to fruit every time you visit the fruit page.

Also actually instead of a full raccoon or a full dragon, it might evolve a raccoon tail from fruit and then dragon horns from lots of wine, so I want to make something like slots for head or tail or whatever.

So thing number two is tracking those slots somehow. Right now I'm using a PHP code that will change the image url depending on what the session variable says. So I'd like to do this a better way, but it's lower priority.

Thing number three is I guess some kind of if/else statement going "if fruits=42, tail_session=raccoon, else, tail_session=no_tail." This is also a bit lower on my priority list because I at least know that those are called if/else statements so I can probably work on looking these up (now that I thought of them).

The most important thing is adding to variables based on either click or page load.

Is that any better?
 
I like this idea a lot. I can't say I have a suggestion on how to code it, but if you figure it out I shall support you.
 
I like this idea a lot. I can't say I have a suggestion on how to code it, but if you figure it out I shall support you.

Thanks!

---

All variations of the quiz code are creating blank pages. I guess I missed something? In the meantime, I ran into a page view code while searching for other quiz scripts to test.

The idea is that every time you go to page x, it will add to the x variable.

<?php
session_start();
if(isset($_SESSION['feed']))
$_SESSION['feed'] = $_SESSION['feed']+ 1;
else
$_SESSION['feed'] = 1;

echo "feed = ". $_SESSION['feed'];
?>

But then none of the if/else scripts and variations I've tried will work. It's fine with stationary variables, but when I use this changing one, only one part of the if/else works.

What I want this code to do for now is something like "if you've eaten less than ten apples, $tail=none, else if you've eaten ten or more apples, $tail=kittytail," but if I can't get an if/else to work...

Argh, I can do it in Actionscript just fine, but I don't want to make a Flash game.

What's wrong with it?

Code:
<?php
if ($feed <= 9) {
$_SESSION['tail']=blah;
}
else {
$_SESSION['tail']=blahblahblah;
}
?>

Edit: Oh, and I guess this is in play too.

<?php
session_start();

if(isset($_SESSION['tail']))
$_SESSION['tail'] = $_SESSION['tail']= $_SESSION['tail'];

else
$_SESSION['tail'] = none;
echo "tail = ". $_SESSION['tail'];
?>

<?php $tail=($_SESSION['tail']) ?>
 
Last edited:
Back
Top Bottom