Before smartphones dominated our pockets, there was the golden era of Java ME (J2ME) gaming. It was a time when a screen resolution of 128x160 pixels was the standard, and "3D graphics" meant a wireframe vector grid. Among the countless games that defined this era, one title stands out as a rite of passage for mobile gamers: Snake Xenzia.
This example provides a very basic implementation. Enhancements can include collision detection refinement, smoother animations, score tracking, and more. Java Snake Xenzia Game . Jar . 128x160 .
public static final int TILE_SIZE = 8;
public static final int GRID_W = 128 / TILE_SIZE; // = 16
public static final int GRID_H = 160 / TILE_SIZE; // = 20
SnakeXenzia.jar
├── META-INF/MANIFEST.MF (Main-Class: SnakeGame)
└── SnakeGame.class
└── GamePanel.class
└── Snake.class
└── Food.class
└── ScoreManager.class
Phoneky: Another popular repository where you can download the .jar file directly. Reliving the Legend: A Deep Dive into Java