https://github.com/colintr/marioqt
Playable Super Mario Bros Nes style Mario level editor
https://github.com/colintr/marioqt
c mario qt
Last synced: about 1 month ago
JSON representation
Playable Super Mario Bros Nes style Mario level editor
- Host: GitHub
- URL: https://github.com/colintr/marioqt
- Owner: ColinTr
- License: mit
- Created: 2020-06-05T12:56:46.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-20T09:39:19.000Z (almost 2 years ago)
- Last Synced: 2025-02-05T19:59:56.764Z (over 1 year ago)
- Topics: c, mario, qt
- Language: C++
- Homepage: https://colintr.me/mario/Mario.html
- Size: 42.6 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Mario QT
A playable Super Mario Bros Nes style Mario level editor
[](https://opensource.org/licenses/MIT)
[](https://colintr.fr/mario/Mario.html)
### Play it live at https://colintr.fr/mario/Mario.html !
## 🚀 Installation
For windows: download the installer
## 🎮 Controls
- 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

## 🔧 Updating and compiling the code
1. Download [Qt Creator](https://www.qt.io/download-qt-installer-oss) and install Qt 5.15.2 MSCV 2019
2. 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
```
3. 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"
## 🎥 Trailer
https://www.youtube.com/watch?v=-SCnSPH7mK8
## ❓ What is it
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.
## 💻 Installation
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).
## 🛠️ Software Composition
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.
## ⚙️ Game Inner Workings
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.
## 📸 Game Screenshots
- Level editor:

- Main menu:

- Options menu:

## ⚖️ License
This code is released under the MIT license. See the LICENSE file for more information.