quangdong26 / Embedded3_groupAssignment

0 stars 3 forks source link

🕹️ Mario Game with Bare Metal Programming

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.


🎮 Gameplay Overview

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.


🚀 Getting Started

Step 1: Create a .env File

Since 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

Step 2: Build the Project

  1. Set up the environment with the .env file.
  2. Follow the instructions to build the game and load it on your Raspberry Pi.
  3. Execute the game using QEMU or on actual Raspberry Pi hardware.

Step 3: Playing the Game


🛠️ Features

1. Background and Scrolling

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.

2. Obstacles and Enemy (Goombas)

3. Character Control and Animation

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.


🧑‍💻 Task Contribution Table

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

🎨 Graphics and Rendering

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.

Image Display

Video Playback

Font Display


🎮 How the Game is Played

Mario’s movement is controlled by physics and key inputs:


📊 Results


🖥️ Technical Implementation

Key functions include: