A modified version of the popular 1980 Atari game Centipede built in MIPS assembly.
Report a Bug
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.
- Open the
centipede.s
file in MARS. - 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.
- Set the Unit Width in Pixels to
- 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.
- Assemble the program by clicking on Run in the menu bar and selecting Assemble, or by clicking in the tool bar.
- Start the game by clicking on Run in the menu bar and selecting Go, or by clicking in the tool bar.
j
- move leftk
- move rightx
- shoot Darts
- start and retryq
- quit
- Animations
- Continually repaints the screen with appropriate assets.
- 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).
- Once the Centipede reaches the bottom it invades the Bug Blaster's space.
- Core Gameplay Features
- Mushrooms are randomly generated when the game starts.
- Fleas randomly spawn at the top and fall down, they have a chance of spawning a Mushroom while falling.
- The Centipede dies after 3 Dart hits, Fleas die and Mushrooms are destroyed after 1 Dart hit.
- Only one Dart can be travelling at a time.
- The Bug Blaster (player) loses a life when the Centipede or a Flea intersect with it.
- Start, Game Over and Retry screens help provide a better experience.
- Extra Features
- 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.
- 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.
- Important messages are displayed on the screen in text.
- Additional Information
- The direction constants are: 0 - North, 1 - East, 2 - South, 3 - West.
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.