University of Toronto Summer2021 CSC258 project Dedong Xie
This is the project for CSC258 in the University of Toronto Summer term 2021.
Please follow the below setup:
Running the code game.asm
using MARS Simulator
MARS Simulator: https://courses.missouristate.edu/KenVollmar/MARS/
MARS runs on Java, please have Java installed on your machine (or install it from https://www.oracle.com/java/technologies/javase-jdk16-downloads.html)
After opening the code in the simulator, use Tools -> Bitmap Display
and Tools -> Keyboard and Display MMIO Simulator
, both connected to MIPS.
Use the below setup for Bitmap Display
:
- Unit width in pixels: 8
- Unit height in pixels: 8
- Display width in pixels: 256
- Display height in pixels: 256
- Base Address for Display: 0x10008000 ($gp)
Use F3
to assemble the code then press the green run
button on the top middle bar of MARS to start the game.
Input in the Keyboard Simulator's KEYBOARD
area to control the game.
Use of keyboard in the game:
- w: spaceship go up
- a: spaceship go right
- s: spaceship go down
- d: spaceship go left
- p: restart the game
- e: end the game
Enjoy Gaming !!!
CSC258 Project proposal
- The type of project
- Individual project
- I will do the project myself.
- (Why not looking for a partner? Time zone differences + I feel myself suitable for doing it on my own (doing so individually will be more challenging but I will try to make it)
- 10000% myself :D
- Individual project
- Description of game
- Basic game rules
- Spacecraft moving on a rectangular game area, moves controlled by input from keyboard.
- Random obstacles appear in the game area and consistently generating new from right and vanishing from left.
- Target is to prevent interaction with the obstacles, each crash will result in reduction of health.
- Showing hp (health points) as hearts on the top of game view
- When you run out of health, game ends.
- Have a game start menu screen and end of game screen.
- Additional features
- Create animation for the hit/hurt/break of spaceship/obstacle and allow grazing (interaction with small part may result in a reduction of damage) (This is a modification of the grazing feature, which also involves random number to represent chances of a near miss)
- Assign points to player on every successful prevention of crash and show total score on the end of game screen.
- Changeable difficulty/difficulty adjust to game play (become harder and harder as time goes by increasing moving speed, length of obstacles, and new look of obstacles) (This is a combination of the features i and ii.)
- Basic game rules
- Proposed methodology
- I will have two methods for generation of obstacles and spaceship, each will write to memory
- I will use two methods correspondingly to erase spaceship and obstacles, each will assign the painted points black
- I will use random generator to get the initial position in rows of obstacle
- I will scan the screen and determine collision in each frame by d(spaceship, obstacle) < obstacle_size
- When collision happens, the animation of hurt will be triggered by chance
- I track multiple obstacles on the screen by storing their positions in memory
- I track position of spaceship also in memory
- I will increase the difficulty by changing the pre-stored generating rate and level variable, which enables multiple types, more obstacles, and faster for them to move
- Planned milestones
-
Milestone 1
- Create spaceship avatar
- Create obstacle figure
- Obstacle appear, move and disappear
- Create game start screen
- Create game end screen
- Showing health hearts on top of the screen
- Enable restart by pressing “P” on the keyboard
-
Milestone 2
- Spaceship move according to keyboard input
- Collision detection and recording (by reduce of health)
- Show remaining “health” of the ship (will be reduced on each collision)
- Running out of health -> game over screen
-
Milestone 3
- Assign score to player when successfully avoid collision
- Implement different types of collisions by different color on the spaceship and reduction of health
- Implement different types of obstacle (different size, color, look)
- Add difficulty by increase speed, appearance rate, size, color of obstacles every 10 seconds (possibly show a screen of level up?)
-
All the codes for printing on the canvas is generated by the automatic tool xxx_asm_gen.c written by me, you can find those .c files in src and they are just a modified version of my previous repository: UofT_CSC258_lab08_Avatar_assembly_generator.