Skip to content

helgi-dev/space-swirls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Space Swirls

Space Swirls is an interactive multiplayer space shooter game designed for the MZAPO educational board. Players navigate spaceships through space and battle each other by firing projectiles and utilizing randomly generated power-ups.

User Manual

📄 Click here to see User Manual

Compilation, Installation, and Execution

This project is built to run directly on the physical MZAPO board or locally via an emulator.

Prerequisites for MZAPO Board

Before running the game on the physical board, you must add the required SSH private key to your SSH agent for password-less authentication: ssh-add ~/.ssh/mzapo-root-key

(Note: The exact path to the key may vary depending on your local setup. On lab computers, the key is typically located at /opt/zynq/ssh-connect/mzapo-root-key).

Running on the MZAPO Board (Local Lab Network)

To cross-compile the game for the ARM architecture, transfer it to the board, and execute it automatically in one step, run: make TARGET_IP=192.168.223.xxx run

(Replace xxx with the actual IP address of your MZAPO board).

Running on the MZAPO Board (Remote Access / Eduroam)

If you are connecting from outside the lab network (e.g., from home or via Eduroam), you must route the connection through the university's gateway using ProxyJump: make TARGET_IP=192.168.223.xxx SSH_OPTIONS="-o ProxyJump=harvaane@postel.felk.cvut.cz" run

Running via Local Emulator (macOS/Linux)

To compile the game for your local machine using the SDL-based emulator, use the EMUL=1 flag: make EMUL=1

Once compiled, you must first start the emulator backend in the background, followed by the game executable: ./emulator/emul & ./game

Cleaning the Project

To remove all compiled object files, dependencies, and executables, run: make clean

Application Architecture

The application is modularized into several key components to separate game logic from hardware interactions and visual rendering.

Module Diagram

Application Architecture Diagram

Component Details

Core & Logic (Custom Modules)

  • main.c / main.h: The core engine. Contains the primary game loop (while(1)), context initialization, and state machine transitions (Menus vs. Playing state).
  • main_phys.c / main_phys.h: The physics and collision engine. Handles vector mathematics and updates movement logic utilizing precomputed trigonometric tables for optimal performance on the ARM processor.
  • input_processing.c / input_processing.h: Fetching and processing hardware input. Translates raw knob data into rotation offsets, single clicks (shooting/pausing), and double clicks (activating power-ups).
  • collision_logic.c / collision_logic.h: Handles circular collision detection between ships, projectiles, and power-up entities.
  • bounds_check.c / bounds_check.h: Checking player, projectile and ship angle bounds to keep entities inside the active screen area.
  • led_handling.c / led_handling.h: The peripheral controller. Translates the players' remaining lives to the 32-bit LED strip and assigns power-up statuses to the side RGB LEDs.

Graphics & UI (Custom Modules)

  • main_visuals.c / main_visuals.h: The rendering engine. Maps game objects to the PARLCD display buffer. Responsible for drawing 2D sprites, applying hit-effect color filters, and rendering text fonts.
  • menus_handling.c / menus_handling.h: The UI layer. Manages the rendering and logic of the Main Menu, Pause Menu, and Game Over screens.

Data & Assets

  • blue_player.h, red_player.h, power_ups.h, etc.: Data storage headers containing static arrays of pixel data for animations in RGB565 format.
  • font_prop14x16.c, font_rom8x16.c, font_types.h: Font definitions and typographical structures required for rendering text strings on the display.

Peripheral Drivers (External Instructor Code)

  • mzapo_parlcd.c / .h: Low-level driver for parallel data transfer to the MZAPO LCD display.
  • mzapo_phys.c / .h: Handles the mapping of physical hardware peripheral addresses into the virtual memory space.
  • mzapo_regs.h: Contains definitions of register offsets for I/O operations on the MZAPO board.

About

Interactive 2D multiplayer space shooter for MZAPO board. Features inertia-based movement, power-ups, and full hardware integration (LCD, LED strip, RGB LEDs).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages