Skip to content

A modified version of the popular 1980 Atari game Centipede built in MIPS Assembly.

License

Notifications You must be signed in to change notification settings

KirillTregubov/Centipede-MIPS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screenshot of the Centipede game

CSC258 Winter 2021 Assembly Centipede Game

A modified version of the popular 1980 Atari game Centipede built in MIPS assembly.
Report a Bug

Software Setup

Ensure you have the Java SE Development Kit (1.5 or later) installed by running java -version in a terminal or download it here.

To run this game you will need a MIPS Assembler and Runtime Simulator. This guide will assume you are using the MARS IDE which you can download here.

Quick Start

  1. Open the centipede.s file in MARS.
  2. Set up the display by clicking on Tools in the menu bar and selecting Bitmap Display.
    • Set the Unit Width in Pixels to 8.
    • Set the Unit Height in Pixels to 8.
    • Set the Display Width in Pixels to 512 (set by default).
    • Set the Display Height in Pixels to 512.
    • Set the Base address for display to 0x10008000 ($gp).
    • Click the Connect to MIPS button once these are set.
  3. Set up the keyboard by clicking on Tools in the menu bar and selecting Keyboard and Display MMIO Simulator.
    • Click the Connect to MIPS button.
    • When playing the game, make sure the bottom KEYBOARD input field is focused and reflecting your inputs.
  4. Assemble the program by clicking on Run in the menu bar and selecting Assemble, or by clicking the wrench and screwdriver button in the tool bar.
  5. Start the game by clicking on Run in the menu bar and selecting Go, or by clicking the play button in the tool bar.

Controls

  • j - move left
  • k - move right
  • x - shoot Dart
  • s - start and retry
  • q - quit

Features

  1. Animations
    1. Continually repaints the screen with appropriate assets.
    2. Draws 10-segment Centipede (with a distinct cyan head segment, green body and zigzag movement), Bug Blaster (orange body with green eyes), Dart (blue block that move upwards), Mushrooms (brown blocks) and Fleas (purple blocks that move downwards).
    3. Once the Centipede reaches the bottom it invades the Bug Blaster's space.
  2. Core Gameplay Features
    1. Mushrooms are randomly generated when the game starts.
    2. Fleas randomly spawn at the top and fall down, they have a chance of spawning a Mushroom while falling.
    3. The Centipede dies after 3 Dart hits, Fleas die and Mushrooms are destroyed after 1 Dart hit.
    4. Only one Dart can be travelling at a time.
    5. The Bug Blaster (player) loses a life when the Centipede or a Flea intersect with it.
    6. Start, Game Over and Retry screens help provide a better experience.
  3. Extra Features
    1. A scoreboard is displayed on the top left of the screen, it increments by 10 when the Centipede dies, by 5 when a Flea dies, by 1 when a Mushroom is destroyed.
    2. The player has 5 lives and the number of lives is displayed on the top right of the screen, the game ends when all lives are exhausted.
    3. Important messages are displayed on the screen in text.
  4. Additional Information
    • The direction constants are: 0 - North, 1 - East, 2 - South, 3 - West.

Known Issues

There is currently a known issue with version 4.5 of MARS (the latest as of writing) where the entire application freezes due to a threading issue - a deadlock caused by a function called when handling the simulated keyboard input. For a more detailed explanation along with a suggested fix, please visit this article by dtConfect.

About

A modified version of the popular 1980 Atari game Centipede built in MIPS Assembly.

Topics

Resources

License

Stars

Watchers

Forks