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:
Tue May 26 07:26:13 2020 +0000
Revision:
9:759b419fec3b
Parent:
7:94bc3e21d664
Child:
10:2ae9d4145410
Aliens working similar to bullets with random

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MatisRequis 2:d59a92e65bd9 1 #ifndef TEMPESTENGINE_H
MatisRequis 2:d59a92e65bd9 2 #define TEMPESTENGINE_H
MatisRequis 2:d59a92e65bd9 3
MatisRequis 2:d59a92e65bd9 4 #include "mbed.h"
MatisRequis 2:d59a92e65bd9 5 #include "N5110.h"
MatisRequis 2:d59a92e65bd9 6 #include "Gamepad.h"
MatisRequis 6:037dfa5064a1 7 #include "Bullet.h"
MatisRequis 4:8e3ba8d6d915 8 #include "Hero.h"
MatisRequis 3:54132cf073d7 9 #include "Board.h"
MatisRequis 9:759b419fec3b 10 #include "Alien.h"
MatisRequis 2:d59a92e65bd9 11
MatisRequis 6:037dfa5064a1 12 #include <vector>
MatisRequis 9:759b419fec3b 13 #include <cstdlib>
MatisRequis 9:759b419fec3b 14 #include <ctime>
MatisRequis 6:037dfa5064a1 15
MatisRequis 2:d59a92e65bd9 16 class TempestEngine {
MatisRequis 2:d59a92e65bd9 17
MatisRequis 2:d59a92e65bd9 18 public:
MatisRequis 2:d59a92e65bd9 19
MatisRequis 2:d59a92e65bd9 20 TempestEngine();
MatisRequis 2:d59a92e65bd9 21 ~TempestEngine();
MatisRequis 2:d59a92e65bd9 22
MatisRequis 4:8e3ba8d6d915 23 void init();
MatisRequis 4:8e3ba8d6d915 24 void read_input(Gamepad &pad);
MatisRequis 2:d59a92e65bd9 25 void draw(N5110 &lcd);
MatisRequis 4:8e3ba8d6d915 26 void update();
MatisRequis 9:759b419fec3b 27
MatisRequis 9:759b419fec3b 28 //BULLET FUNCTIONS
MatisRequis 6:037dfa5064a1 29 void create_bullets();
MatisRequis 6:037dfa5064a1 30 void draw_bullets(N5110 &lcd);
MatisRequis 9:759b419fec3b 31 void update_bullets();
MatisRequis 9:759b419fec3b 32
MatisRequis 9:759b419fec3b 33 //ALIEN FUNCTIONS
MatisRequis 9:759b419fec3b 34 void create_aliens();
MatisRequis 9:759b419fec3b 35 void draw_aliens(N5110 &lcd);
MatisRequis 9:759b419fec3b 36 void update_aliens();
MatisRequis 2:d59a92e65bd9 37
MatisRequis 2:d59a92e65bd9 38 private:
MatisRequis 6:037dfa5064a1 39 //////////////////OBJECTS////////////////////
MatisRequis 6:037dfa5064a1 40 Board _board;
MatisRequis 6:037dfa5064a1 41 Hero _hero;
MatisRequis 7:94bc3e21d664 42
MatisRequis 2:d59a92e65bd9 43
MatisRequis 6:037dfa5064a1 44 /////////////////VARIABLES////////////////
MatisRequis 2:d59a92e65bd9 45 int _column_amount;
MatisRequis 2:d59a92e65bd9 46 int _bullet_speed;
MatisRequis 4:8e3ba8d6d915 47 float _d;
MatisRequis 4:8e3ba8d6d915 48 int _mag;
MatisRequis 2:d59a92e65bd9 49 int _a;
MatisRequis 6:037dfa5064a1 50 int _bullet_timer;
MatisRequis 9:759b419fec3b 51 int _alien_timer;
MatisRequis 9:759b419fec3b 52 int _alienspeed;
MatisRequis 6:037dfa5064a1 53
MatisRequis 6:037dfa5064a1 54 /////////////////VECTOR/////////////////
MatisRequis 6:037dfa5064a1 55 std::vector<Bullet> bullet_vect;
MatisRequis 9:759b419fec3b 56 std::vector<Alien> alien_vect;
MatisRequis 2:d59a92e65bd9 57 };
MatisRequis 2:d59a92e65bd9 58
MatisRequis 2:d59a92e65bd9 59 #endif