This project is an implementation of a Mario Game using Bare Metal Programming on a Raspberry Pi. The game runs directly on the hardware without an underlying operating system, leveraging the screen, keyboard input, and command-line interface for logging and debugging.
The player controls Mario, who must navigate through obstacles and enemies while attempting to reach the end of the level. Mario can move left, right, and jump to avoid obstacles and fall into valleys. The game environment scrolls to simulate Mario moving forward through the game world.
.env
FileSince QEMU (Quick Emulator) varies across operating systems (Windows, Mac, etc.), you need to create a .env
file to specify your environment settings.
remove_command := rm
force := -f
rasp_window := raspi3
.env
file.The game features a dynamically scrolling background, which creates the illusion that Mario is moving forward through the world while maintaining his central position on the screen.
Mario’s movements, including jumping and running, are fully animated. The character responds to player inputs with smooth transitions between standing, running, and jumping animations.
Each team member contributed equally to the development of the Mario game, focusing on different aspects of the project:
Team Member | Contribution (%) | Task Description |
---|---|---|
Dinh Minh | 25% | - Game logic for Mario (collision, scrolling, physics) |
Luong | 25% | - Goomba logic and Mario movement |
Dong | 25% | - Rendering assets and bug fixing |
Shirin | 25% | - Image rendering and Goomba collision |
The project extends the screen drawing capabilities to display large images, videos, and fonts using ARGB32 color encoding. The frame buffer mechanism manages the pixel data directly, allowing for complex image rendering and scrolling.
Mario’s movement is controlled by physics and key inputs:
Key functions include:
renderBackGround()
: Renders the game background.drawMario()
: Draws the Mario sprite at his current position.applyGravity()
: Simulates gravity to update Mario's jump.moveObstacleToLeft()
: Scrolls the background to simulate Mario moving forward.