Skip to content

"Pass To Survive" - Android game on Java & libGDX, platformer with 2 levels.

License

Notifications You must be signed in to change notification settings

adiyat-abubakirov/pass-to-survive

Repository files navigation

🎮 Pass To Survive

GitHub Created At GitHub Release GitHub repo size GitHub License

📄 Description

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.

🚀 Key Features

  • Lombok for less code space, it automates creation of Builders, Setters, Getters, & many more.
  • Inheritance from PlayGameScreen abstract class with Builder & effective usage of abstract method setCheckpoint for Level Classes.
    • For PlayGameScreen, I created Builder myself b/c inheritance required super.
  • Inheritance fromTileObject abstract class, to make contactListener call inContactAct method to trigger actions corresponding to the specific TileObject child, regardless of what object is in contact with Player.
  • Created joystick by implementing Joystick class with Actor inheritance for communication with libGDX API & implementing JoystickInputListener class 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 the AllComponents.pack file.
    • .tmx - maps that contains position for all the graphics & physical bodies on maps, use .png files 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.

Info

  • 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.

Prerequisites

  • Minimum Android Version: 4

Special thanks to Brent Aureli for libGDX tutorials.

If you found this repository helpful, please give it a ⭐