Coder Social home page Coder Social logo

buggedmatrix's Introduction

Bugged-Matrix

1 vs 1 Arena Shooter Game - but with bad physics and bad controls

Setup/Installation

Game

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.

Development enviroment

  1. Install Android Studio
  2. Clone the repository
  3. Open Android Studio
  4. Select "Import Project (Gradle, Eclipse ADT, etc.)"
  5. On path select PATH_WHERE_YOU_CLONED_THE_REPOSITORY_TO\BuggedMatrix (it will look someting like ...\BuggedMatrix\BuggedMatrix) and hit ok
  6. 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.
  7. 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.
  8. 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)).

Development documentation

Class diagram

UML

State diagram

Game Cycle

Design Patterns

Singleton:

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:

GameLoop

Easier to develop and understand how the game runs.

Model-View-Controller:

MVC

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

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.

Major dificulties

  • 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

Lessons learned

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

Overal Time Spent Developing

~50 hours each member.

Work Distribution

Equal between the two of us.

Other notes

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

User Manual

Touch screen to begin. MainScren

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

On Android:

Use the joysticks and the buttons to move and shoot. AndroidGame

Shoot the other player 3 times to win. RedWon BlueWon

Touch screen again to go back to Main Menu.

buggedmatrix's People

Contributors

rekicho avatar pedrogneto avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.