Last week, our project was to work on Greenfoot Greeps, the first Greeps competition project from 2007. If you’ve read my commentary about Greenfoot before, then you know just how much fun Greenfoot is.
Greeps is a little scenario game where you have little aliens that absolutely love tomatoes. The deal is that you have to code the logic for them to get around. The rules aren’t complicated, basically limiting you to not abusing the all those wonderful Greenfoot location methods.
Anyway, here are my few tips when dealing with Greeps.
- Forget about making a path finder with those spit puddles. Absolutely worthless.
- Add a bit of randomness.
- To avoid getting stuck on edges or water, bounce off at a 45 or 90 angle.
- If you’re trying to get home with a tomato and get stuck, you’ll have to backup, turn some amount, move forward a bit and then try to get home again.
- Keep trying, but don’t completely get rid of your old code. As you make progress in terms of finding tomatoes and bringing them back to the ship, save your Greep.java somewhere just in case you want to revert to it in the future. I did that a lot.
I don’t really want to give much away but these minor hints should save you some time.
For the record, my Greeps implementation earned me 160 tomatoes averaged over 3 runs. I won third place in my AP Computer Science class.