Skip to content

Playable Super Mario Bros Nes style Mario level editor

License

Notifications You must be signed in to change notification settings

ColinTr/MarioQT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mario QT

A playable Super Mario Bros Nes style Mario level editor

License: MIT License: MIT

🚀 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

Screenshot

🔧 Updating and compiling the code

  1. Download Qt Creator 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:

Screenshot

  • Main menu:

Screenshot

  • Options menu:

Screenshot

⚖️ License

This code is released under the MIT license. See the LICENSE file for more information.

About

Playable Super Mario Bros Nes style Mario level editor

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •