This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

matt.milan
matt.milan presents ...

2012/3/9

Squirrel Quest

Essentially, a modified bugworld.

Features:

levels
powerups
HUD
multiple enemies
a boss

future changes will include:
changed graphics
level recap screen
more enemy types
alternate mushroom positions
different backgrounds
eventually, walls.

3753 views / 955 in the last 7 days

4 votes | 0 in the last 7 days

Tags: game demo with-source cabrillo

open in greenfoot
Your browser does not support the canvas tag.
ZariLewisZariLewis

2012/3/10

Great game! You clearly put in a lot of extra time and effort. Game feels very complete. Fits well into the Survival/Squirrel genre, would be nice if you could fight back though.
matt.milanmatt.milan

2012/3/10

I forgot to mention that you get a powerup if you eat 6 cactuses. It wears off after each "level" though. Did you make it to the boss? I still have to finish the boss level (shuold be like level 5 or 6) but i wanted to upload what i had so far
dlannidlanni

2012/3/10

Great job Matt! Really fun to play. I looked at your code for squirrel to figure out how you changed speed after eating cherries. I see "speed=0", then after berries eaten "speed +=5" etc. Where is method for speed? I looked in mover, but only saw the usual. It would be great if you could add some comments to your code to help tyros like myself learn how to write great code like yours!
matt.milanmatt.milan

2012/3/10

yeah you're right. let me update the code with some comments. codes kind of messy too. let me clean that up
matt.milanmatt.milan

2012/3/10

The following code is what the speed thing boils down to. Speed is basically just an int variable that i use in my "if key is pressed, the move that way" methods. it combines the value of speed (which can be negative or positive, negative lets me "stun" the character by making his total movement zero, but if this goes negative we'll get some wierd results) with the number in the move() method. Speed is increased when i eat a berry. Speed is decreased once the berry timer runs out. take a look: private final int BERRIESTIMER = 500; private boolean berriesEaten = false; private int speed = 0; public void act() { checkKeysPressed(); lookForBerries(); if (berriesEaten) { berriesTimer(); } } public void checkKeysPressed() { if (Greenfoot.isKeyDown("right")) { setRotation(0); move(5 + speed); } // the rest of the keys to follow } public void lookForBerries() { if (canSee(Berries.class)) { eat(Berries.class); speed+= 5; berriesEaten = true; myPoints += 200; Greenfoot.playSound("berries.wav"); } } public void berriesTimer() { berriesTimeLeft--; if (berriesTimeLeft == 0) { berriesEaten = false; speed -= 5; berriesTimeLeft = BERRIESTIMER; } }
matt.milanmatt.milan

2012/3/10

what i meant was, if move(5 + speed) results in a negative number, we'd get backwards movement which wouldnt make any sense. unless the squirrel was confused. actually, that gives me an idea
This game is so bad...omg
matt.milanmatt.milan

2012/4/16

did the starfish get ya? he gets me too, i cant even beat level 3 and i made the game lol

Want to leave a comment? You must first log in.

Who likes this?

thegreencoolerman Minecraftserver1125 Busch2207 ZariLewis