Hiikaru
Run.
- Pronoun
- he
tl;dr - how can I make eevee evolve on all existing pages conditionally?
Okay, I got all the styles on the Eevee game up and working and it's awesome and my little sister is pretty ecstatic about it (she comments on how great PHP styleswitchers are every time she plays with it now).
But there's one thing that I haven't been able to revive from the old version yet. I use to have it so that there was a Pikachu in a different subdirectory that you could also choose to play with by clicking the Pikachu button. I'd really rather not put all the images and styles and pages in a new Pikachu folder again. I'm looking for a way that I can use PHP variables and functions or something similar to tell the site to replace all Eevees with Pikachus when the variable is turned on by the user.
What I would also like to do with this is make it so you can evolve Eevee. So the navigation bar would have an option to go look at stones, like:
anypage.php
navbar.php
evolve.php
And then when you click on whatever stone, it replaces all Eevees with the evolution.
evo.php
Also, can I use variables to give Eevee happiness, hunger, etc? In the Flash version of the Eevee game, every page that wasn't x took away from x, so if you did anything besides give Eevee food, Eevee slowly got hungrier. When it got hungry enough, something appeared to indicate that Eevee was hungry. When you fed it, the message went away until it got too hungry again. You didn't have to feed it or bathe it or whatever when it wanted you to, it's just something that keeps my sister busy.
needs.php
I've been looking at variable tutorials all day, and I found a script that can do something like this, but it uses a drop down menu.
exampledropdownimageswitcher.php (which isn't really named that)
Since my sister is five and is still learning to read, this is an image based game, and as such I don't want the drop down menu. Also, I think this particular code would reset back to Eevee on a different page, so that's no good. I would use the same thing for Pikachu except replace Eevee with Pikachu instead of with an evolution. I wouldn't add Pikachu now, except my sister wants him, and I already have the art.
How can I write the code to evolve Eevee?
Okay, I got all the styles on the Eevee game up and working and it's awesome and my little sister is pretty ecstatic about it (she comments on how great PHP styleswitchers are every time she plays with it now).
But there's one thing that I haven't been able to revive from the old version yet. I use to have it so that there was a Pikachu in a different subdirectory that you could also choose to play with by clicking the Pikachu button. I'd really rather not put all the images and styles and pages in a new Pikachu folder again. I'm looking for a way that I can use PHP variables and functions or something similar to tell the site to replace all Eevees with Pikachus when the variable is turned on by the user.
What I would also like to do with this is make it so you can evolve Eevee. So the navigation bar would have an option to go look at stones, like:
anypage.php
include needs.php!
include navbar.php!
include evo.php!
<page specific Eevee here>
<this page takes away from all $needs that are not it>
<this page adds to the relevant $need>
navbar.php
Feed Eevee (goes to feed.php)
Brush Eevee (goes to brush.php)
Give Eevee drink (goes to drink.php)
Bathe Eevee (goes to bath.php)
Take Eevee to closet (goes to closet.php)
Evolve Eevee (goes to evolve.php)
evolve.php
include evo.php!
use firestone
use waterstone
use thunderstone
And then when you click on whatever stone, it replaces all Eevees with the evolution.
evo.php
$firestone (global replace "images/eevee/" with "images/flareon/" somehow)
$waterstone (global replace "images/eevee/" with "images/vaporeon/" somehow)
$thunderstone (global replace "images/eevee/" with "images/jolteon/" somehow)
$eevee (leave Eevee alone, you guys)
$moon (evolve eevee into Umbreon, plus, only display this if happiness is good)
$sun (evolve eevee into Espeon, plus, only display this if happiness is good)
the $evo variable says:
if user clicks firestone, do $firestone
else if user click waterstone, do $waterstone
else if user clicks thunderstone, do $thunderstone
default = $eevee
also keep this variable no matter what the user does unless they click the magical devolve eevee wand, kthnx
Also, can I use variables to give Eevee happiness, hunger, etc? In the Flash version of the Eevee game, every page that wasn't x took away from x, so if you did anything besides give Eevee food, Eevee slowly got hungrier. When it got hungry enough, something appeared to indicate that Eevee was hungry. When you fed it, the message went away until it got too hungry again. You didn't have to feed it or bathe it or whatever when it wanted you to, it's just something that keeps my sister busy.
needs.php
(describe needs variables here)
if $hunger is <=10, print (Eevee is hungry! &<img indicating hungriness>)
else if $hunger is <=0, print (Eevee is starving!&<img indicating too much hungriness>
else if $hunger=<-100 print (Eevee is dead!&<img of deadness, plus, display an option to revive eevee which resets happiness to zero> optional if she wants Eevee to be able to die, which she might
default is print (nothing at all)
display needs_array in this order, variables earlier in the array cover up the later variables
array order=
$hunger
$thirst
$hygiene
also display happiness at any time
if happiness=0 (do nothing)
if happiness=<10 (show one heart)
if happiness=<20 (show two hearts)
if happiness=<50 (show three hearts, plus, show the option to evolve eevee into Umbreon or Espeon if you view evolve.php)
I've been looking at variable tutorials all day, and I found a script that can do something like this, but it uses a drop down menu.
exampledropdownimageswitcher.php (which isn't really named that)
(my real drop down menu codes are organized better than this)
<?php include("images_and_variables.php") ?>
<form Name = "f1" action="switch1.php" method="post">
<select name="picture">
<option value="none">Select one</option>
<option value="pika">pika</option>
option value="eevee">eevee</option>
</select>
<input type="submit" name = "Submit" Value = "Choose an Image">
</form>
<?php
if (isset($_POST['Submit'])) {
$picture = $_POST['picture'];
if ($picture == "eevee") {
print ("$eevee?");}
else if ($picture == "pika"){
print ("$chu?");}
else {print ("nothing!");}}
?>
Since my sister is five and is still learning to read, this is an image based game, and as such I don't want the drop down menu. Also, I think this particular code would reset back to Eevee on a different page, so that's no good. I would use the same thing for Pikachu except replace Eevee with Pikachu instead of with an evolution. I wouldn't add Pikachu now, except my sister wants him, and I already have the art.
How can I write the code to evolve Eevee?