1 vs 1 Arena Shooter Game - but with bad physics and bad controls
To run the game on Desktop, just download BuggedMatrix-Desktop.jar and execute it (be sure to have JRE installed). To run the game on Android, download BuggedMatrix-Android.apk, execute it and it will install the game (you may need to allow "Install from other sources" on your Android definitions if you haven't done it already) and then just execute the app called BuggedMatrix. To run the HTML version, put all the files in BuggedMatrix-HTML on a web server (or localhost) and access it.
- Install Android Studio
- Clone the repository
- Open Android Studio
- Select "Import Project (Gradle, Eclipse ADT, etc.)"
- On path select PATH_WHERE_YOU_CLONED_THE_REPOSITORY_TO\BuggedMatrix (it will look someting like ...\BuggedMatrix\BuggedMatrix) and hit ok
- To run the android version, just go to Run->Run.. , select Android, connect an Android (where developer mode and run degub mode are active) or create a Virtual device, and the game will run.
- To run the desktop version, select DesktopLauncher class, go to Run->Edit Configurations.., change Working Directory to ...\BuggedMatrix\BuggedMatrix\android\assets and the Run->Run.. and select DesktopLauncher.
- To run the test, just go to a test class, a green circle should appear on the left of each function, click it and then click tun test. (Altough it is possible to run multiple tests at the same time, some will fail if done so (as we used SINGLETON, some test function will interfere with the others, so to get correct test results, only one funcion should be run at a time)).
Singleton:
Used in: GameController, GameModel
We can only have on game happening at each time, so it makes sense to use a singleton for each Game class
Game Loop:
Easier to develop and understand how the game runs.
Model-View-Controller:
- Model: Represents the game logic and rules.
- View: Outputs the game represantion for the user to see.
- Controller: Reads and interprets the user commands and linkes them with Box2D world.
Allows us to separate different concerns, making it easier to make changes to each one of them without collapsing the others.
Factory:
Used in: View Entity Package
Code has higer abstraction and allows to easily create and implement new views, as well as change those already created.
- Getting what was happening in the game world (Box2D) to match what was being shown to the player (getting units right, game withd and height, joystick input ...).
- Modelling the player as a set of bodies and joints (and not just one body)
- Overall, libgdx has so many features that is easy to get lost on what we need to use
- Also, it's documentation was sometimes lacking, not explaning what some parameters meant
- Plan small and expand if we have time. We started wanting a lot of features, but then as we didn't have time started giving up some of them.
- Do the boring work first, so we have motivation to keep working.
~50 hours each member.
Equal between the two of us.
- Due to the use of Singleton design pattern, all the test functions should be tested separately, or GameController.reset() should be called between them, so that the instance of the game changes.
- The project was based on teacher Restivo's AsteroidArena game, so the structure is a lot similar.
- We weren't being able to use Junit with AndroidStudio and Libgdx, so we had to use an "test runner" from another repository.
- The test runner is GdxTestRunner.java and it's repo is this.
On Desktop:
Press W, A, S and D to move player 1 and C to shoot. Use the arrows to move player 2 and L to shoot.
On Android:
Use the joysticks and the buttons to move and shoot.
Shoot the other player 3 times to win.
Touch screen again to go back to Main Menu.