A playable Super Mario Bros Nes style Mario level editor
Play it live at https://colintr.fr/mario/Mario.html !
For windows: download the installer
- Q and D for left and right control
- Space to jump
- Shift to shoot fireball
- T to show hitboxes
- R to restart the level
- C for power-up
-
Download Qt Creator and install Qt 5.15.2 MSCV 2019
-
Compiling an executable (see https://www.youtube.com/watch?v=rFHPOZoqzcg):
cd C:\Qt\5.15.2\msvc2019\bin\ windeployqt.exe C:\Users\Username\Desktop\Mario.exe
-
Compiling for webassembly (see https://www.youtube.com/watch?v=YSAUoAI5hQA):
cd emsdk emsdk activate 1.39.8 cd mario-webassembly-build qmake MarioQT\source_code mingw32-make
If you have memory errors during mingw32-make, add the following flag to the Mario.pro file:
QMAKE_LFLAGS+= "-s TOTAL_MEMORY=33554432"
https://www.youtube.com/watch?v=-SCnSPH7mK8
This software is part of the DI4 C++ QT project. It was developed by Guillaume Bouchard, Colin Troisemaine, Alexandre Turpin, and Quentin Levieux. The goal was to create a Mario-type platformer game using QT and the MVC pattern. We aimed to reproduce the NES game Super Mario Bros.
Since the project is a QT project, it is cross-platform. We recommend installing QTCreator for compiling the project (File -> "Open File or Project" and select Mario.Pro).
The software is composed of several parts, the main part being the game itself. There is also a graphical level editor that allows exporting created levels in JSON format, a key configuration window also exportable in JSON format, all accessible from the main menu.
The game follows the MVC model and is divided into three distinct parts:
-
The model consists of subclasses of ObjectModel that represent all the objects in our game. The objects are divided into two categories: inerts (non-moving objects) and entities (objects with the advance() function).
-
The view is composed of the GameView class, which is a QWidget and displays the objects on the screen using Visitor (see the design pattern).
-
The controller with the GameController class, which contains the main loop of our game. GameController has a list of objects and, at each iteration of its main loop (the advance() function), calculates the new position of the objects, checks for collisions with other objects, resolves collisions if necessary, and finally animates the object. Then, it calls the view to repaint its scene.
- Level editor:
- Main menu:
- Options menu:
This code is released under the MIT license. See the LICENSE file for more information.