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.
Ninto, if you press up or down, it speeds up/slows down.
mjrb4, I have already compressed and uploaded the scenario on Greenfoot Discuss. I will put my updated version on Greenfoot Discuss in a few minutes.
A new version of this scenario was uploaded on Wed Mar 11 20:50:26 UTC 2009
i agree that the acceleration and decceleration (sorry for the spelling) is really unneeded just make it to where it speeds up to a certian point and then stops just like mjrb said about the classic snake
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.
ok Drumlind11. I had just looked at you source-code and figured out how to make the score-thing work:
public void uploadScore(java.awt.Color c) {
GreenfootImage bar = getImage();
bar.clear();
bar.drawImage(new GreenfootImage("Untitled-1.png"), 0, 0);
bar.setColor(c);
bar.drawString(""+score, 7, 16);
bar.drawString(""+hiScore, 100, 16);
}
and the in the snakeWorld constructer place the SB at 80, 3 instead of 4.
2009/3/11
2009/3/11
2009/3/11
2009/3/11
2009/3/11
2009/3/11
2009/3/12
2009/3/13
2009/3/13
2009/3/13
2009/3/20
2009/3/20
2009/3/20
2009/3/20
2009/3/20
2009/3/20
2009/3/21
2009/3/21
2009/3/21
2009/3/21
2009/3/23
2009/3/23
2009/3/23