A simple snake game, mainly consisting of simple
constructs which are subject in a first semester computer science. It consists of two classes, the executable
Snake.java and SnakePart.java which Represents
a part of the body of the snake.
In the foreground are operations on a 2D array as a game field, simple query constructs (Is the box to the right
of me in the field? Is there something to
eat? ...), a linked list as snake and
recursive calls on this.
Something, outgoing is the use of Frames for visualization and a KeyListener, for the detection
of keystrokes.
It is controlled by WASD. The game can not be lost - this part is suitable, after understanding the code to practice in order to enhance the
source code to collision treatment.