Reference no: EM131949300
Assignment
Objective
In this lab, you will incorporate all of the concepts you learned in labs #1 through #6 to design a game.
Description
Write an ARM assembly language / C program that implements the game Micro Space Invaders, as described below.
Synopsis
This version of Space Invaders is a simpler version than the original, 1978 version. The objective of Micro Space Invaders is the same as the original: shoot down the invaders from space to earn points and to advance to the next level. You start the game with four (4) spaceships (lives). The invaders will always start in the same position, but their starting movement, left or right, must be random. You must avoid being shot by the invaders. A good way not to be shot is to hide behind the strong shields(s) on the field. However, if you or the invaders shoot at a strong shield, it will be weakened to a weak shield(s), and if shot again, it will disappear for the rest of that level. Once all invaders on level 1 are cleared, you will be given points for completing that level and progress to the next level. The game is on a two-minute timer and ends regardless of the circumstances when the two minutes are up (unless all of your spaceships have already been lost - in that case the game will end prematurely). To get used to the game and begin to understand what you have to do, there is an online version you can play. Note that the online version is slightly different from Micro Space Invaders and is intended to give you an idea about how the game is played, if you have never played before.
Basic Flow of Program
• The player must be given instructions on how to play the game, what they should expect in the game including gameplay, invaders and potential points to be earned / taken, and also how to start or quit the game
• Excluding the walls, the playable game board should be 21x15
• The player can shoot
• The player cannot move faster than the refresh rate of the game
• There should be 35 invaders on every level
• Enemies must be different ASCII characters (O,M,W)
• A single shot from your spacecraft will destroy any invader. One shot can destroy only one invader at a time.
• If the players shot (^) and an invaders shot (v) collide the bullets should go through each other. When the bullets are in the same location on the board as each other a (~) character must be printed to represent the bullets crossing each other.
• The level increases once all invaders are destroyed. This does not include the motherships.
• Mothership bonus points must be randomly generated
• The motherboard must travel faster than the invaders move
• Motherships starting side (left or right) must be random and must travel the whole top row of the board before disappearing
• If the player is shot, he will lose 100 points and one life
• The player begins with four lives/spaceships
• The LEDs should be illuminated to reflect the number of lives left. When a life is lost the life count on the LEDs must be decremented by turning one LED off. When all LEDs are off, the game is over. For example, if three lives remain, three LEDs should be illuminated.
• There should be a GAME OVER screen to alert the player they are done and to ask if they wish to quit or play again
• The program starts at level 0 when in pre-game mode and increments by one for every level completed. This should be displayed somewhere on the screen.
• The seven-segment display should display the score that the user has obtained on that level. The score will reset to 0 at the start of each level but the data from each level will be stored.
- Time Level Points: You should save the points you earned from killing the invaders minutes the points you lost when you died
- Death Count: How many lives you lost during that level
- Mother Ships: How many mother ships you killed out of how many passed during that level (Example: 1/3)
- Level: The time to took you to complete that level
• The external interrupt can be used to pause the game. The game screen should state the game is paused. When the game is paused, the RGB color is blue.
• When completing a game, a comprehensive breakdown should be shown to the player including Level Points, Death Count, Mother Ships, Level Time, and total points earned. The user should be asked if they wish to play again or quit. The RGB LED should be purple during this process.
• During gameplay the RGB color should be green. When the player has been shot by an invader (bullet has strickened the player), the RGB LED should flash red. When the game is paused the RGB LED should be blue. When gameplay has ended the RGB LED should be purple.
Hardware Utilized
• Serial Port - User Input & Display
- Used to accept the user's input and display the game.
• LEDs - Number of Lives
- The LEDs will represent the number of lives remaining. You will start the game with four lives (all LEDs on). Each time a life is lost, an LED is turned off.
• RGB LED - Game Status
- The RGB LED should be used to display the status of the game. During game play the RGB color should be green, when a shot if fire it should flash red, when paused it should be blue. At the end of the game it should be purple. Before game play starts it should be white.
• Seven -Segment Display - Level Score
- The seven-segment display should display the score the user currently has on that level. To avoid overflow on the seven segment display the score should be reset (put back to zero) each time a new level is reached.
• Momentary Push Button (P0.14) - Pause Button
- This button should be configured to trigger an interrupt when pushed, and will be used to pause and start the game. Note that when the game is paused, the user must be told so and the RGB LED must be set to blue.
• Timers - Control Game Movement
- The timer is used to control the game speed and refresh the display. During the first level (level 1), characters should move two times per second.
- With each level increase, the period should decrease by 0.1 seconds. Once the rate becomes 0.1 seconds, the speed will no longer change. In other words, new levels after that point will no longer speed up the game play.
- The timer should be used to control the time for the entire game (2 minutes).
Attachment:- Micro-Space-Invaders-Game.rar