Matis Requis 201241242

Dependencies:   mbed

Tempest Game

Game Screen

https://os.mbed.com/media/uploads/MatisRequis/tempest_board_wiki.png The board is made of 12 columns. The Hero stays at the top of the column

Game Controls

https://os.mbed.com/media/uploads/MatisRequis/gamepad_buttons.png

To control the hero spaceship point the joystick to the column you want the hero to go to.

Press the A button to shoot a bullet in the column you are currently in.

Committer:
MatisRequis
Date:
Wed May 27 05:53:03 2020 +0000
Revision:
12:1f1907ebebeb
Parent:
10:2ae9d4145410
Final Submission. I have read and agreed with Statement of Academic Integrity

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MatisRequis 2:d59a92e65bd9 1 #ifndef BOARD_H
MatisRequis 2:d59a92e65bd9 2 #define BOARD_H
MatisRequis 2:d59a92e65bd9 3
MatisRequis 10:2ae9d4145410 4 // Included Libraries
MatisRequis 2:d59a92e65bd9 5 #include "mbed.h"
MatisRequis 2:d59a92e65bd9 6 #include "N5110.h"
MatisRequis 2:d59a92e65bd9 7 #include "Gamepad.h"
MatisRequis 2:d59a92e65bd9 8
MatisRequis 8:5feb1913bc92 9 #include <algorithm>
MatisRequis 8:5feb1913bc92 10
MatisRequis 10:2ae9d4145410 11 /** Board Class
MatisRequis 10:2ae9d4145410 12 * @brief Draws the game board and draws the paths the bullets and aliens take
MatisRequis 10:2ae9d4145410 13 * @author Matis Requis
MatisRequis 10:2ae9d4145410 14 * @date May, 2020
MatisRequis 10:2ae9d4145410 15 */
MatisRequis 2:d59a92e65bd9 16 class Board {
MatisRequis 2:d59a92e65bd9 17 public:
MatisRequis 10:2ae9d4145410 18
MatisRequis 10:2ae9d4145410 19 /** Constructor */
MatisRequis 2:d59a92e65bd9 20 Board();
MatisRequis 10:2ae9d4145410 21
MatisRequis 10:2ae9d4145410 22 /** Destructor */
MatisRequis 2:d59a92e65bd9 23 ~Board();
MatisRequis 10:2ae9d4145410 24
MatisRequis 10:2ae9d4145410 25 /** Draws the board
MatisRequis 10:2ae9d4145410 26 * @param lcd @details N5110 object
MatisRequis 10:2ae9d4145410 27 */
MatisRequis 2:d59a92e65bd9 28 void draw(N5110 &lcd);
MatisRequis 10:2ae9d4145410 29
MatisRequis 10:2ae9d4145410 30 /** Generates a path for each column that the alien and bullet use */
MatisRequis 2:d59a92e65bd9 31 void path();
MatisRequis 10:2ae9d4145410 32
MatisRequis 10:2ae9d4145410 33 /** Function that uses the bresenham line algorithm to generate an array in a line
MatisRequis 10:2ae9d4145410 34 * @param x0 @details x coordinate of the first point
MatisRequis 10:2ae9d4145410 35 * @param y0 @details y coordinate of the first point
MatisRequis 10:2ae9d4145410 36 * @param x1 @details x coordinate of the second point
MatisRequis 10:2ae9d4145410 37 * @param y1 @details y coordinate of the second point
MatisRequis 10:2ae9d4145410 38 * @param array[14] @details Vector2D array to store the points of the line
MatisRequis 10:2ae9d4145410 39 */
MatisRequis 8:5feb1913bc92 40 void drawpath(int x0, int y0, int x1, int y1, Vector2D array[14]);
MatisRequis 10:2ae9d4145410 41
MatisRequis 10:2ae9d4145410 42 /** Vector2D struct used to store the path */
MatisRequis 8:5feb1913bc92 43 Vector2D drawcolumn[12][14];
MatisRequis 2:d59a92e65bd9 44
MatisRequis 2:d59a92e65bd9 45
MatisRequis 2:d59a92e65bd9 46 };
MatisRequis 2:d59a92e65bd9 47 #endif