

This is because I am using the C console. It would also be helpful (but not necessary) if instead of writing "() ", you write "c.println()".

This code works with no problem on "Ready to Program" for Java. Here is the current source code I have developed. I have a slight idea that I will have to use a loop to keep moving the snake (this loop I THINK would be located inside a branch(if/else) of the method: movement). In which case, the snake should change its movement to the corresponding direction. For example, when I press the 'S' key, the snake will move down (until it hits the wall) unless I press W, A, or D. The problem is that I would like this motion to be continuous and ALERT to other keys pressed. It is classic.Ĭurrently, the snake moves 1 square/20 pixels each time I press the W, A, S, or D key. This game is the same as the one for the old Nokia phone.

I am new to programming and am stuck on a particular part involving the change in direction for the snake.
