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

matt.milan's Comments

Back to matt.milan's profile

Solid. i got about 45 points. how bout making a score display when the player dies? :)
i'm going to change it so that the particle accepts a parameter of shapeSize so that it's size is determined upon creation, not while it's moving, cause they all change when i click. not sure if that's what we want here i'm at a real loss about joining the dots. i thought about changing it from fillOval to drawLine. i also think that the particles have to be able to communicate with eachother somehow.
after i ate all the humans, it became hamburger racing
i think i crashed the boat about 8 times. it would be cool to see the boat have some kind of "drift" movement logic.
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
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; } }
yeah you're right. let me update the code with some comments. codes kind of messy too. let me clean that up
Is raver z a reference to racer d?
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