Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Engine.cpp
- Revision:
- 6:cae24a40ab34
- Parent:
- 5:88886c1bd2c1
- Child:
- 7:4c19433600c8
--- a/Engine.cpp Sat Apr 01 11:44:22 2017 +0000 +++ b/Engine.cpp Sun Apr 02 17:47:21 2017 +0000 @@ -8,7 +8,7 @@ { } -void Engine::init(int friendly_width,int friendly_height,int ship_size,int speed) +void Engine::init(int friendly_width,int friendly_height,int ship_size,int speed,N5110 &lcd, Gamepad &pad) { _friendly_width = friendly_width; _friendly_height = friendly_height; @@ -22,6 +22,7 @@ _ship3.init(_ship_size,_speed); _ship4.init(_ship_size,_speed); _ship5.init(_ship_size,_speed); + _bullet.init(lcd,pad,_speed); } void Engine::read_input(Gamepad &pad) @@ -34,6 +35,7 @@ { lcd.drawRect(0,0,WIDTH,HEIGHT,FILL_TRANSPARENT); _friendly.draw(lcd); + _bullet.draw(lcd); } void Engine::ship1_gen(N5110 &lcd) @@ -61,6 +63,11 @@ _ship5.draw(lcd); } +void Engine::bullet_gen(N5110 &lcd) +{ + _bullet.draw(lcd); +} + void Engine::update(N5110 &lcd, Gamepad &pad) { check_pass(pad); @@ -71,6 +78,7 @@ _ship3.update(); _ship4.update(); _ship5.update(); + _bullet.update(); check_death(lcd, pad); }