Skip to content

Pereira-Luc/SnakeGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SnakeGame

  • This is a simple snake game. The snake is controlled by the arrow keys. The food is randomly generated. It includes a map editor and some pre-defined maps.

  • The game was tested on a Windows 11 and Arch Linux using the Java Version 17-18. The Jar file is included in the repository

  • The Jar file can be run without any additional libraries.

Map Editor

* The map can be saved by clicking the "Save Map" button.
     This will open a Window where you can save the map.
  • The map can be loaded by clicking the "Load Map" button.
  • Map files also include all the other settings.

MAP inside the XML file:

The map is inside of map tag. All the cells have a default value of 0. [ value="0" ] If the value is 1, the cell is a wall.
Row (row) Cell (cell) Cell (cell) Cell (cell) Row (/row)
Row (row) Cell (cell) Cell (cell) Cell (cell) Row (/row)

Settings

In (brackets) is the tag for the setting

Option
(options)
Info
Game Speed
(snakeSpeed)
The speed of the game. The higher the number, the faster the game.
Snake Size
(snakeSize)
The size of the snake. The higher the number, the longer the snake. (In the start)
Point Multiplier
(pointMultiplier)
The multiplier for the points. The higher the number, the more points you get for eating food.
Amount Of Food
(foodAmount)
The amount of food on the map. The higher the number, the more food there is.
Snake Grow
(snakeGrow)
The Grow rate of the snake for eating food. The higher the number, the faster the snake grows.
Snake Color
(snakeColor)
The color of the snake. ( Can only be changed in the xml file )
Food Color
(foodColor))
The color of the food. ( Can only be changed in the xml file )

Compile

  • I compiled the game with IntelliJ IDEA. The following commands were used:

  • mvn clean compile

  • mvn package

  • Or it can also be run from:

  • View >>> Tool Windows >>> Maven >>> clean & package

Release Links

Download Snake v1.0.0
Download Maps