Matis Requis 201241242
Dependencies: mbed
Tempest Game
Game Screen
The board is made of 12 columns. The Hero stays at the top of the column
Game Controls
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.
Diff: TempestEngine/TempestEngine.cpp
- Revision:
- 7:94bc3e21d664
- Parent:
- 6:037dfa5064a1
- Child:
- 8:5feb1913bc92
diff -r 037dfa5064a1 -r 94bc3e21d664 TempestEngine/TempestEngine.cpp --- a/TempestEngine/TempestEngine.cpp Mon May 25 07:46:48 2020 +0000 +++ b/TempestEngine/TempestEngine.cpp Mon May 25 09:08:25 2020 +0000 @@ -19,11 +19,6 @@ //draw hero ship _hero.draw(lcd); - - - - //draw ennemies -// _ennemy.draw(lcd); //draw bullets draw_bullets(lcd); @@ -31,8 +26,8 @@ } void TempestEngine::read_input(Gamepad &pad) { _d = pad.get_angle(); - _mag = pad.get_mag(); - _a = pad.A_pressed(); + _mag = pad.get_mag(); + _a = pad.A_pressed(); } @@ -42,24 +37,26 @@ } void TempestEngine::create_bullets() { - if (_bullet_timer <= 0) { - if (_a == 1) { + //if (_bullet_timer <= 0) { + if (_a) { Bullet new_bullet; new_bullet.init(_hero.get_column()); bullet_vect.push_back(new_bullet); - _bullet_timer = 5; + //_bullet_timer = 5; } - } - _bullet_timer--; + //} + //_bullet_timer--; } + //draws all the bullets void TempestEngine::draw_bullets(N5110 &lcd) { //iterates through the bullet objects for (int i = 0; i< bullet_vect.size(); i++) { + bullet_vect[i].update(); //draws current bullet bullet_vect[i].draw(lcd);