Skip to content

Coder-ACJHP/Modern-Snake

Repository files navigation

Modern Snake

Simple snake game that include core functionality for classic snake but overrided some properties like : user can change background color or can play from control panel and change settings etc.The game builded on Java SE(Swing & AWT) libraries and packaged with Maven.

There is just two external library used in this project :

  1. AppleJavaExtentions library (used for adding application icon in dock)
  2. JZoom library (used for playing mp3 files)

Modern Snake screen shot

The game designed on mvc pattern

  • Model : including Snake, Food, Directions and SoundPlayer classes
  • View : including GamePanel(display), ControlPanel(Control pad) classes
  • Controller : including MainFrame(Main window *container* ) and InitializeSettings class

How to play ?

Download the project from here then import it in any IDE (I used Eclipse) then start the /Snake/src/com/coder/snake/start/Snake_Modern.java class and enjoy

You can also control the snake from your keyboard (arrow keys ⬅️ ➡️ ⬆️ ⬇️ )

You can easily export the game as single executable '.jar' with Maven

How to export the game as single executable jar platform independed ?

Just add this maven-assembly-plugin into your POM.XML file then run the following code in your IDE or Terminal :

In new version (1.2.1.RELEASE) above plugin already added

mvn clean compile assembly:single

Or download the game as (.app) for MacOS or (.jar) for all OS from this link: Modern-Snake-1.2.1 releases

That's it 😍🎉 enjoy with your time 👍

For any question 🤔 please 📧 me at : hexa.octabin@gmail.com

I hope this help to juniors learn basics of building game via Java, thank you for reading 😊