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.
Dependencies: mbed
Diff: SpaceInvadersEngine/SpaceInvadersEngine.cpp
- Revision:
- 13:9d6ee753eca6
- Parent:
- 12:45b1249b3d9a
- Child:
- 53:db66345d6755
--- a/SpaceInvadersEngine/SpaceInvadersEngine.cpp Mon Apr 15 14:36:07 2019 +0000 +++ b/SpaceInvadersEngine/SpaceInvadersEngine.cpp Fri Apr 19 17:33:57 2019 +0000 @@ -7,44 +7,33 @@ SpaceInvadersEngine::~SpaceInvadersEngine() { - + + } - Direction _d; - //_mag; - void SpaceInvadersEngine::init(int space_ship_width,int space_ship_height,int bullet_size, int alien_size, int speed) +void SpaceInvadersEngine::init(int space_ship_width,int space_ship_height,int bullet_size, int alien_size, int speed) { // initialise the game parameters - int _space_ship_width= space_ship_width; - int _space_ship_height= space_ship_height; - int _bullet_size= bullet_size; - int _alien_size= alien_size; - int _speed= speed; - + _space_ship_width= space_ship_width; + _space_ship_height= space_ship_height; + _bullet_size= bullet_size; + _alien_size= alien_size; + _speed= speed; - /* // x position on screen - WIDTH is defined in N5110.h - _p1x = GAP; - _p2x = WIDTH - GAP - _paddle_width; - - // puts paddles and ball in middle - _p1.init(_p1x,_paddle_height,_paddle_width); - _p2.init(_p2x,_paddle_height,_paddle_width); - _ball.init(_ball_size,_speed); - - */ + } void SpaceInvadersEngine::read_input(Gamepad &pad) { _d = pad.get_direction(); - //_mag = pad.get_mag(); + _mag = pad.get_mag(); } -void SpaceInvadersEngine::draw(N5110 &lcd) +/*void SpaceInvadersEngine::draw(N5110 &lcd) { // draw the elements in the LCD buffer // pitch @@ -52,6 +41,7 @@ lcd.drawLine(WIDTH/2,0,WIDTH/2,HEIGHT-1,2); //score print_scores(lcd); + -} +}*/