Java Snake

Screenshot von Snake

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.

Download

Java Snake
The packed files "Snake.java" and "SnakePart.java".
Snake.zip
Komprimiertes Archiv im ZIP Format 2.4 KB

Profil von Michael Grönert auf LinkedIn anzeigen

 

Michael Grönert

 

Michael Grönerts DevBlog anzeigen

 

Michael Grönert auf GitHub anzeigen

 

Profil von Michael Grönert auf DeviantArt anzeigen