This game is a demo of my skills, knowledge with Java & libGDX.
Stack: Java 21, Gradle 8.11, libGDX 1.10, Lombok 1.18, Maven, Android Studio, Tiled (TMX Maps), LeakCanary 2.14.
Note
- For gameplay, see gameplay.mp4.
- libGDX is compatible with any platform, including IOS & PC.
- For project structure of Java classes, see classes.png.
- Lombok for less code space, it automates creation of Builders, Setters, Getters, & many more.
- Inheritance from
PlayGameScreenabstract class with Builder & effective usage of abstract methodsetCheckpointforLevelClasses.- For
PlayGameScreen, I created Builder myself b/c inheritance requiredsuper.
- For
- Inheritance from
TileObjectabstract class, to make contactListener callinContactActmethod to trigger actions corresponding to the specificTileObjectchild, regardless of what object is in contact withPlayer. - Created joystick by implementing
Joystickclass with Actor inheritance for communication with libGDX API & implementingJoystickInputListenerclass for touch control which communicates with App using libGDX API. - Usage of diverse files to provide graphics, sound, animation, buttons, & text:
.pack- texture packs, tell the game in which part of a png file, the specific image is located..json- needed for all buttons in the game to set them a texture (pressed & released) from theAllComponents.packfile..tmx- maps that contains position for all the graphics & physical bodies on maps, use.pngfiles as source of graphics.
- Doesn’t use Viewport to scale graphics, all graphics are optimized for different screens using just the coefficient of width & height to screen for which graphics was originally scaled. This ensures original aspect of ratio for every graphics. This technique is most often used in
resize()methods. See Example.
- Platformer with 2 levels (each has 2 parts) and 2 skins for the player model.
- Second skin is applied after 20 restarts. After 20th restart, the game will show special animation for second skin instead of "Game Over" screen.
- Player's velocity is dependent on joystick's pull.
- There are 2 "Game Over" screens, 2 "Win" screens, and a "Pause" screen.
- The game works in native resolution and native refresh rate of the phone.
Special thanks to Brent Aureli for libGDX tutorials.