Inspiration

I have always been a gamer, having played consoles as back as the Atari 2600 game console, so the inspiration for this Mario game project stemmed from a desire to build classic games with modern development technologies. This project shows the capabilities of Java, Gradle, and LibGDX, while also highlighting the advantages of modern web deployment through GWT and Docker.

What it does

My Mario game allows players to navigate through a single custom made level, avoiding obstacles, defeating enemies, and collecting coins. The game features responsive controls and clear 2D graphics.

How we built it

I re-made the Mario game using Java and Gradle for project management. The game engine, LibGDX, provided a flexible and powerful framework for creating 2D games. After completing the development, I used GWT (Google Web Toolkit) to transpile the Java code into JavaScript, allowing the game to run in web browsers. Finally, I deployed the application in a Dockerized Angular app, hosted on a Render cloud hosting platform. The mario map was made using the Tiled software in a .tmx file format

Challenges we ran into

During the development process, I encountered several challenges:

  • The LibGDX dependencies kept getting corrupt, which meant that their imports into the source code could not be resolved, so I had to refresh Gradle project, clean caches and run ./gradlew clean build several times
  • Several Java standard data structures, like the LinkedHashMap. were not compatible with GWT transpiler, so I have to search on stackoverflow for alternatives that worked
  • Render cloud host slows down activity for the website after a period of inactivity, making the website takes longer to load, which is a server-side feature that cannot be bypassed with free instances

Accomplishments that we're proud of

Successfully implementing game logic and physics in Java and correctly transpiled into JavaScript code that is playable in web browsers, and successfully running a docker image of the angular app on a cloud platform. If, for some reason, you do not want to play using your browser, you can still play the game using a Java Compiler, or in any IDE that supports Java.

What we learned

I learnt how game collision works, and how to invoke certain actions as a result, such as Mario dying as a result of colliding with a Goomba or a Turtle. I also learnt how to transpile one programming language into another. Lastly, I learnt how to successfully create and render a docker image of any web framework, including angular and react.

What's next for Mario

Fixing some bugs in the game logic, making my own custom new levels, and creating a final playscreen scene showing that the user has reached the end of the game. Maybe multiplayer functionality that comes with some of the javascript frameworks.

Share this project:

Updates