Sizhe Lin / Mbed 2 deprecated missile_command_Sizhe_Lin

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed wave_player

Fork of missile_command by ECE 2035 TA

Embed: (wiki syntax)

« Back to documentation index

main.cpp File Reference

main.cpp File Reference

Go to the source code of this file.

Functions

int main ()
 Main() is where you start your implementation.

Detailed Description

Definition in file main.cpp.


Function Documentation

int main (  )

Main() is where you start your implementation.

The hints of implementation are in the comments.
You are expected to implement your code in main.cpp and player.cpp. But you could modify any code if you want to make the game work better.

2.Begin the game loop

3.Example of drawing the player

4.Example of calling the missile API.

It updates all incoming missiles on the screen

5.Implement the code to get user input and update the player

-[Hint] You could see city_landscape.cpp to get some ideas about how to implement your player.

-[Hint] Implement the code to move player left

-[Hint] Implement the code to move player right

-[Hint] Implement the code to fire player-missile

6.Implement the code to draw a user missile

-[Hint] You could see missile.cpp or missile_generator() for your reference

7.Implement the code to detect the collision between missiles and cities

-[Hint] You could use city_get_info() and missile_get_info()
-[Hint] You could use missile_set_exploded() to notify the missile module that the missile was exploded.
-[Hint] You need to check which city was hit by the missile, and call city_destroy() to destroy it.
-[Hint] You might also check whether the missile hit the land

8.Implement the code to detect a collision between player-missiles and incoming missiles

-[Hint] You could use missile_get_info() to get the position of incoming missile
-[Hint] You could use missile_set_exploded() to notify the missile module that the missile was exploded.
-[Hint] You might also check whether the missile hit the player

9.Implement the code to check the end of game

-[Hint] For example, if there is no more city, it should be gameover.

Definition at line 71 of file main.cpp.