Skip to content

Makuo12/pac-mini

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Micro:bit V2 Pac-Man Game

A simplified Pac-Man game developed for the micro:bit v2 microcontroller using Rust. This implementation focuses on maze navigation and pellet collection without enemies, making it perfect for learning embedded game development. The game utilizes the micro:bit's hardware features, including its LED matrix display, buttons, and timers, to provide an engaging experience.

Features

  • Simplified Pac-Man Gameplay: Navigate through a maze and collect pellets using the micro:bit's button controls, without the pressure of avoiding enemies.
  • LED Matrix Display: The 5x5 LED matrix displays the maze, player position, and remaining pellets in a creative, compact format.
  • Button Controls: Use Button A and Button B to control Pac-Man's movement through the maze.
  • Efficient Memory Management: Leveraging Rust's memory safety features to ensure stable and crash-free gameplay on embedded hardware.
  • Real-Time Operations: The game utilizes the embed crate for managing interrupts and real-time clock (RTC) events using critical section to manage concurrency safely.
  • Low Overhead: The game is designed to be lightweight and efficient, ensuring smooth performance on the microcontroller.

Technologies Used

  • Rust: The game is built entirely in Rust, utilizing its powerful embedded ecosystem.
  • microbit v2 crate: Provides support for the micro:bit v2 hardware, enabling interaction with buttons, LEDs, and other features.
  • embed crate: Used for embedded programming, including handling real-time operations and safe concurrency.
  • critical section: Ensures safe access to shared resources in a multi-threaded environment.

Installation & Setup

To flash the game onto your micro:bit v2, follow these steps:

  1. Clone the repository:

    git clone https://github.com/yourusername/microbit-pacman.git
    cd microbit-pacman
  2. Install Rust for Embedded Development: Follow the setup instructions for Rust Embedded

  3. Install Dependencies: Ensure you have the necessary dependencies installed. You can do this by running:

    rustup target add thumbv7em-none-eabihf
    cargo install probe-rs
  4. Flash the Game: Use probe-rs to flash the compiled binary onto your micro:bit v2:

    cargo embed --release

Usage

Once the game is flashed onto your micro:bit v2, you can start playing:

  • Button A: Move Pac-Man left/up (depending on game state)
  • Button B: Move Pac-Man right/down (depending on game state)
  • Objective: Navigate through the maze and collect all pellets to win!

The LED matrix will display your current position and the maze layout. Collect all the pellets to complete the level!

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or feedback, please contact uwau2544@gmail.com.

About

A small game like pac man with no enemies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors