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

Super_Hippo's collections

This user has no collections

Recent Comments | Show All

I am not exactly sure what causes it, but you are making it harder than it is. If your Body/Head extend Snake, you should not have fields with the same name as in the Snake class. How I just made it work: Remove all "direction" variables, the "go" and "calcV" methods, simply turn the actor in the direction it should move and move it with the move method. Then when adding a new body part, you can add it to the world with the same rotation as the last one and move it back one cell. Save the "prevdir" at the beginning of the act method of Body/Head.


"Press start" --> Have to press space to start