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

Report as inappropriate.

eljones
eljones presents ...

2009/3/27

SquirrelLauncher

Move with the arrow keys and throw
rocks with space. Don't get hit by
the hunter. Make it to the acorn to
win!

2266 views / 16 in the last 7 days

Tags: None

There is no HTML 5 translation of this scenario available.
View legacy version (requires Java plugin)

This scenarios uses Java features that are not available for use after conversion to HTML 5. Please try the legacy version, which requires the Java plugin to be installed.

mjrb4mjrb4

2009/3/27

Nice idea, but at the moment it doesn't seem to quite work - the squirrel gets stuck in the corners very easily. This is a fairly classic problem - it's probably because in your collision detection, you're preventing the squirrel from moving if it collides with the hedge (to stop it going through it) but in doing so you're also preventing it from moving AWAY from the hedge. What you probably need is a bit of code that checks what direction the squirrel's moving in, and then allows it to move away from the hedges but not towards them. If you're stuck, feel free to post the source code and I'll take a look along with anyone else that wants to help out!
A new version of this scenario was uploaded on Wed Apr 15 04:49:03 UTC 2009
mjrb4mjrb4

2009/4/15

Much better movement, I don't get stuck any more! However, I'm still a bit lost as to where I need to go, is there some kind of end to the maze? Some instructions would be good as well.
A new version of this scenario was uploaded on Mon Apr 27 03:29:08 UTC 2009
A new version of this scenario was uploaded on Mon Apr 27 03:35:25 UTC 2009
mjrb4mjrb4

2009/4/27

Definitely coming along! I managed to win :-) You might want to use the setPaintOrder method in world so that the text appears on top of everything else when you finish! Few other suggestions, one's visual - making the white around the acorn image transparent would mean it doesn't stand out when the whole world changes colour. Photoshop would do that no problem, or you can use Paint.NET, which is free and will do it just as well! Also, movement of the rocks and the barrels seems a little jerky at the moment, making them smoother will make it much easier to see what's coming and then make an effort to avoid them, rather than just going for it and hoping for the best!
or GIMP would work just as well.
mjrb4mjrb4

2009/4/30

It would - personally I'm not a huge fan of it scattering a thousand windows left right and centre (unless it's changed these days? long time since I've used it.) But yup, any decent image editing program should do the trick (just not MS paint!)
may i see the trigonometric aspect of the code for the hunter?
mjrb4mjrb4

2009/6/8

If you want code to point at a certain position, have a look at the comments in this scenario: http://greenfootgallery.org/scenarios/197

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

Who likes this?

No votes yet.