This holds stat1.
stat1.txt
75
This holds stat2.
stat2.txt
25
This is what makes the pet's stats change and confirms it was done.
parser.php
$icecream = $_POST['icecream'];
$play = $_POST['play'];
$eaten = $_POST['eaten'];
$question = $_POST['question'];
$tv = $_POST['tv'];
$fp = fopen("fatness.txt", "r");
$fatness = fread($fp, filesize("fatness.txt")+1);
fclose($fp);
$fatness = $fatness+$cry+$icecream+$play+$eaten+$question+$tv;
if($fatness>100)
{$fatness = 100;}
if($fatness<0)
{$fatness = 0;}
$fp = fopen("fatness.txt", "w");
fwrite($fp, $fatness);
fclose($fp);
?>
Thank you for helping make my pet as healthy and happy as possible. ^^
This is the main page the users see.
index.html
- You're ordering ice cream. You get your fatbaby a: Ultra-Super-Mega-LowFat Custard Cone Lite Vanilla Mint Chocolate Chip Frozen Lard | |
- If forced to exercise with your fatbaby, you would: Chip.Dip.Mouth.Repeat. Two minutes on the Treadmill. Sprint around the block for three hours. Bowl. | - What's the greatest amount of food your fatbaby has ever eaten at one sitting? A plate-ful. Three corn kernels. 50 pounds worth. The equivilant of a juvenile elephant. |
- Which came first, the chicken or the egg? Chicken Egg Fish Who cares? They all taste the same. | - Favorite TV Channel? Food Network Cartoon Network ESPN TV LAND!! |
Pets made, edited, scripted, owned, and all that pretty jazz by Rydian Morrison.
Questions made by The Masta Writa.
This is the image, it needs a background image that has the pet on it to be 400x225 pixels. Also, the text here is light green because the original image I used was black.
image2.php
$fp = fopen("stat1.txt", "r");
$stat1 = fread($fp, filesize("stat1.txt")+1);
fclose($fp);
$fp = fopen("stat2.txt", "r");
$stat2 = fread($fp, filesize("stat2.txt")+1);
fclose($fp);
$mainimage = imagecreatefromjpeg("mouse_brown1.jpg");
$name = " Name: Chocolate";
$owner = " Specie: Mouse";
$date = "Adoption: May/09/06";
$gender = " Gender: Male";
$backgroundcolor = imagecolorallocate($mainimage,255,255,255);
$textcolor = imagecolorallocate($mainimage,0,255,0);
$barcolor = imagecolorallocate($mainimage,0,200,0);
$bar2color = imagecolorallocate($mainimage,0,200,0);
Imagestring($mainimage,3,4,3,$name,$textcolor);
Imagestring($mainimage,3,4,18,$owner,$textcolor);
Imagestring($mainimage,3,4,33,$date,$textcolor);
imagestring($mainimage,3,4,48,$gender,$textcolor);
$barwidth = 61+$stat1;
$bar2width = 76+$stat2;
Imagestring($mainimage,4,3,180,"Hunger:",$textcolor);
Imagestring($mainimage,4,3,200,"Solitude:",$textcolor);
imagefilledrectangle($mainimage,60,183,$barwidth,193,$barcolor);
imagerectangle($mainimage,60,182,163,193,$textcolor);
imagefilledrectangle($mainimage,75,203,$bar2width,213,$bar2color);
imagerectangle($mainimage,75,202,172,214,$textcolor);
imagerectangle($mainimage,0,0,399,224,$textcolor);
header("Content-type: image/jpeg");
imagejpeg($mainimage);
imagedestroy($mainimage);
?>
$stat1 = fread($fp, filesize("stat1.txt")+1);
fclose($fp);
$fp = fopen("stat2.txt", "r");
$stat2 = fread($fp, filesize("stat2.txt")+1);
fclose($fp);
$mainimage = imagecreatefromjpeg("mouse_brown1.jpg");
$name = " Name: Chocolate";
$owner = " Specie: Mouse";
$date = "Adoption: May/09/06";
$gender = " Gender: Male";
$backgroundcolor = imagecolorallocate($mainimage,255,255,255);
$textcolor = imagecolorallocate($mainimage,0,255,0);
$barcolor = imagecolorallocate($mainimage,0,200,0);
$bar2color = imagecolorallocate($mainimage,0,200,0);
Imagestring($mainimage,3,4,3,$name,$textcolor);
Imagestring($mainimage,3,4,18,$owner,$textcolor);
Imagestring($mainimage,3,4,33,$date,$textcolor);
imagestring($mainimage,3,4,48,$gender,$textcolor);
$barwidth = 61+$stat1;
$bar2width = 76+$stat2;
Imagestring($mainimage,4,3,180,"Hunger:",$textcolor);
Imagestring($mainimage,4,3,200,"Solitude:",$textcolor);
imagefilledrectangle($mainimage,60,183,$barwidth,193,$barcolor);
imagerectangle($mainimage,60,182,163,193,$textcolor);
imagefilledrectangle($mainimage,75,203,$bar2width,213,$bar2color);
imagerectangle($mainimage,75,202,172,214,$textcolor);
imagerectangle($mainimage,0,0,399,224,$textcolor);
header("Content-type: image/jpeg");
imagejpeg($mainimage);
imagedestroy($mainimage);
?>
The image file is where you edit the main looks of it, and it's spread out so you can hopefully see what does what, and edit it to your liking. Please don't let my efforts go to waste. At least learn something!