Very simple snake game code written on pure Java language. Game uses "Constant Game Speed with Maximum FPS" Game Loop. Main logic of game consist of two separate arrays x and y coordinates, without using double array with objects.
Snake is the a one of the most famous older classic video game concept where the player maneuvers a line which grows in length, with the line itself being a primary obstacle.
The size of each of the joints of a snake is by default 32px. The snake is controlled with the WASD keys. Initially, the snake has three joints. If the game is finished, the "Game Over" message is displayed in the middle of the board, then you can start new game.
Download from git using this command:
git clone https://github.com/alma-iceee/Snake-on-Pure-Java.git
Then compile and run Game.class (Shift + F10)
Done! You can start the game!
You can set snake's speed from 5 up to 15.
If you want change some other settings, you can set it inside of code. For example, change preferred screen size in:
private final int BLOCK_SIZE = 16
However, don't forget to recompile main class after change.
There are information about us. Click on "About Us" button in Game Menu.
- Almas Sharipkhan - Main Developer - alma-iceee
- Askarbek Makhmedov - Contributing Developer - askarbek101
- Game Loop - deWiTTERS Game Loop
- Game Logic - ZetCode Java Snake
- Game Architecture - RealTutsGML
This project is licensed under the MIT License.
If you find this code useful for your research, please use the star this repository.
You are welcome to contribute this project.
Thank you!