You don't really need to use the vector class (you can, but personally I wouldn't implement it that way.) True it is trickier to implement realistic gravity, but it is possible - basically the method I use has involved using getObjectAtOffset to look "ahead" so to speak and restrict the movement if the object is just about to approach the ground.
"great excuse for not having gravity"
Of course Mars has gravity! Everything with mass does technically speaking, but Mars definitely has enough mass to have a noticeable amount of gravity. It's only about 38% of earth's, but it's still there!
What about the getColorAt / setColorAt methods in GreenfootImage? As long as the car colour is constant and isn't used in any other part of the picture (though you could alter it to a unique colour if that's not the case already) it'd be pretty trivial to loop through, check for a given colour and replace it with whatever colour you want. Unless my head's not working properly and there's some logic I'm missing!
Woah, it's quite fast! Any chance of including the speed slider so we can slow things down and look at what's happening more clearly? (If you want to include the speed slider, just un-check "lock scenario.")
Hi,
You need to add objects in the world's constructor before you export it to the gallery, because we can't add them in the applet! If you're not sure how to go about doing it, have a look at this: http://www.greenfoot.org/greenroom/images/1/12/Adding_objects.pdf.
2009/5/11
Java quiz
2009/5/11
Mars Patrol
2009/5/11
Formula 0
2009/5/10
Formula 0
2009/5/10
Mars Patrol
2009/5/9
Castle Defense
2009/5/8
Cockroach Random Walk Simulation
2009/5/7
wombats
2009/5/6
snake