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: SpaceInvaderEngine/SpaceInvaderEngine.cpp
- Revision:
- 7:06a2558155f0
- Child:
- 8:86cb9a9f8a73
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SpaceInvaderEngine/SpaceInvaderEngine.cpp Tue Mar 24 16:44:48 2020 +0000 @@ -0,0 +1,31 @@ + +#include "SpaceInvaderEngine.h" + +SpaceInvaderEngine::SpaceInvaderEngine() +{ + +} + +void SpaceInvaderEngine::init(int ship_height, int ship_width, int ship_bullet_size, int alien_size) { + + S1_height = ship_height; + S1_width = ship_width; + A1_size = alien_size; + BS1_size = ship_bullet_size; + + A1y = BORDER + 5; + Vector2D ship_pos = S1.get_position; + BS1x = ship_pos.x; + + A1.init(A1y,A1_size); + S1.init(S1_height,S1_width); + BS1.init(BS1_size,BS1x); + +} + +void SpaceInvaderEngine::read_input(Gamepad &pad) +{ + D = pad.get_direction(); + Mag = pad.get_mag(); +} + \ No newline at end of file