Recall and count the number of squares of each color after they disappear. Be careful, the number of squares of each color will change after each round. Can you beat the high score?
- Once open the game, you will see the main menu. Press m key to start the game.
- The game will show you a sequence of squares of different colors. Remember the number of squares of each color.
- After the sequence disappears, you will be asked to enter the number of squares of each color.
- If you enter the correct number of squares of each color, you will get 1 point. Otherwise you´re out.
- An game over screen will appear when you lose and show messages depending on your score.
- Press m key to restart the game.
- MARS (MIPS Assembler and Runtime Simulator)
- Java 8
- Install Java if you don´t have it installed.
- Download and install MARS from here.
- Clone this repository.
- Open MARS and open the file
main.asm
from the cloned repository. - Go to "Tools"
- Select "Bitmap Display"
- Set the following configuration:
-
Press "Connect to MIPS"
-
Compile and run the game.
The code is in a single file called main.asm
. The code is divided in 2 sections: data, text
In this section we define the variables and constants that we will use in the game.
- Bitmap display arrays: Used to render text into screen, represents row by row the pixels of the screen. Each array represents a color. The arrays are defined as follows:
name | size | value | description
:---:|:---:|:---:|:---:
- score
- target counter
....
Divided into main, functions and interrupts.
Is the main function of the game. It is divided into 3 parts: initialization (menu), game loop and game over.
Render welcome message and wait for user input to start the game.
Render the sequence of squares, wait for user input and check if the user input is correct.
Render game over message and wait for user input to restart the game.
- The game will finish if you enter a number greater than 9.
- The game will finish if you enter a number less than 0.
- The game will finish if you don´t enter an m key to restart the game.
- MARS
- MIPS Assembly Language Programming
- MIPS Assembly Language Programming Using QtSpim
- MIPS Assembly Language Programming
Aaron Santana Valdelomar [savaldev] (https://savaldev.com) UCR - ECCI - Computer Architecture 2023