Slight bug (sorry, I'm a right pain with pointing these out!) but after the ball came off the left hand high ledge and hit the bottom of the circle once it sort of skimmed around it instead of bouncing off.
Hey, I've had a look at the source - it seems to me like you could put another method in the act method of the head class that checks if it's intercepting with each of the segments. (Use getIntersectingObject(Segment.class) .) If you turn this off for the first two segments say but leave it on for the rest, you should be able to raise a flag and therefore do what you want when the snake has eaten itself.
In classic snake, I think it speeds up and down by itself rather than letting you control the acceleration - which probably makes it better in the sense that it's more challenging. Also there's the issue of the snake not eating itself - did you post in Greenfoot discuss a while back about this? If you upload the source we might be able to suggest ways to do what you need.
Hi Stephen,
This doesn't work at the moment because of the filetype case problem - it seems you're using an old version of Greenfoot (it's picked up before you upload in the newer versions, so you might want to upgrade!) Image names are case sensitive - so for example the new version of Greenfoot gives the following:
java.lang.IllegalArgumentException: Filename 'vulnerable.png' has the wrong case. It should be: 'vulnerable.PNG'
at greenfoot.util.GreenfootUtil.checkCase(GreenfootUtil.java:547)
at greenfoot.util.GreenfootUtil.getURL(GreenfootUtil.java:515)
at greenfoot.GreenfootImage.loadFile(GreenfootImage.java:170)
at greenfoot.GreenfootImage.<init>(GreenfootImage.java:75)
at Ghost.<init>(Ghost.java:13)
at PacWorld.<init>(PacWorld.java:19)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at greenfoot.platforms.ide.WorldHandlerDelegateIDE.instantiateNewWorld(WorldHandlerDelegateIDE.java:400)
at greenfoot.core.WorldHandler.instantiateNewWorld(WorldHandler.java:377)
at greenfoot.gui.GreenfootFrame$3.run(GreenfootFrame.java:812)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
You may need to update some of your other images if the cases don't match on them as well - then it should work.
2009/3/15
Pinball Physics
2009/3/15
Congklak (two human player version, with source)
2009/3/15
Pinball Physics
2009/3/13
Natural Selection
2009/3/13
Snake
2009/3/13
Zony
2009/3/11
Snake
2009/3/11
Zony
2009/3/11
Pacman