The Star knight game is a 2D platformer game developed using the LibGDX framework.
- Java 17 or higher
- Android Studio Hedgehog | 2023.1.1 Patch 1 or higher
Note: As none of us in the group have an Android device, we primarily utilized the emulator present in Android Studio to get the game up and running.
- Clone the repository
- Open the project in Android Studio
- Set up an android emulator or connect a physical device (Preferably the default - Pixel 3a)
- Configure the project to run as an Android project
- Enjoy the game 🎮
- Navigate to the root of the project
- Run the following command
./gradlew android:assembleRelease
- The APK file will be located in
android/build/outputs/apk/
Note: An APK file is already compiled and located in the root of the project:
star-knight.apk
.
├── android/ Contains the Android specific code.
│ ├── src/no/ntnu/game/
│ │ ├── AndroidFirebase.java All Firebase logic.
│ │ ├── AndroidLauncher.java Main class for the Android module.
│ │ ├── FirebasePlayer.java Firebase player class.
│ ├── google-services.json Firebase configuration file.
├── core/ Contains the main game logic.
│ ├── src/no/ntnu/game/
│ │ ├── callback/ Contains Firebase callback implementations.
│ │ ├── Controllers/ Contains the different controllers of the game.
│ │ ├── Factory/ Contains the different factories of the game.
│ │ ├── firestore/ Contains the Firestore helper classes.
│ │ ├── Models/ Contains the different models of the game.
│ │ ├── Settings/ Contains setting implementations.
│ │ ├── Sound/ Contains sound implementations.
│ │ ├── Views/ Contains the different views of the game.
│ │ │ ├── Sprites/ Contains the different sprites of the game.
│ │ │ ├── Tutorial/ Contains the tutorial views.
│ │ ├── StarKnight.java Main class for the game.
│ │ ├── CoreFirebase.java Core class that implements the FirebaseInterface.
│ │ ├── FirebaseInterface.java Interface for Firebase methods.
│ │ ├── FirebaseCompatible.java Firebase helper Interface
├── gradle/ Contains the gradle wrapper.
├── .gitignore Contains the files that should be ignored by git.
├── .README.md Documentation
└── ...
Note: The packages 'callback' and 'firestore' are written with lowercase letters to avoid conflicts with the Firebase Firestore package.
This project uses Firebase for the backend. The Firebase SDK is included in the Android module.
The project is set up to use:
- Firebase Realtime Database. Get Started🚀
- Firebase Firestore. Get Started🚀
Firebase is Android specific, i.e you cannot access Firebase methods from the Desktop or Core files. All methods must be called through a class that implements the "FirebaseInterface" located in "core". Any actual Firebase logic should be added into "AndroidFirebase".
For some explanation on how this works, see this video.