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
RosenEngine/RosenEngine.cpp@5:bb6edc5b5be3, 2019-03-05 (annotated)
- Committer:
- ikenna1
- Date:
- Tue Mar 05 07:08:57 2019 +0000
- Revision:
- 5:bb6edc5b5be3
- Parent:
- 4:740e14ebbc97
- Child:
- 7:ed5870cfb3e0
Accidentally saved it to 2645_sprite_motion last time. Also changes it a bit the init function now needs to have values inputted to i think the best course of action would be to create a menu folder to handle the different ships and the title screen
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ikenna1 | 3:f9cd1a38d5c6 | 1 | #include "RosenEngine.h" |
ikenna1 | 3:f9cd1a38d5c6 | 2 | |
ikenna1 | 2:66a4e5d7a7cd | 3 | // Constructor |
ikenna1 | 2:66a4e5d7a7cd | 4 | RosenEngine::RosenEngine() |
ikenna1 | 2:66a4e5d7a7cd | 5 | { |
ikenna1 | 2:66a4e5d7a7cd | 6 | |
ikenna1 | 2:66a4e5d7a7cd | 7 | } |
ikenna1 | 2:66a4e5d7a7cd | 8 | // Destructor |
ikenna1 | 2:66a4e5d7a7cd | 9 | RosenEngine::~RosenEngine() |
ikenna1 | 2:66a4e5d7a7cd | 10 | { |
ikenna1 | 2:66a4e5d7a7cd | 11 | |
ikenna1 | 2:66a4e5d7a7cd | 12 | } |
ikenna1 | 3:f9cd1a38d5c6 | 13 | |
ikenna1 | 4:740e14ebbc97 | 14 | |
ikenna1 | 4:740e14ebbc97 | 15 | // Checks if a mission has been completed and if it has return new mission number |
ikenna1 | 4:740e14ebbc97 | 16 | |
ikenna1 | 4:740e14ebbc97 | 17 | void RosenEngine::init(int ship_speed,int ship_width,int ship_xpos,int ship_ypos) |
ikenna1 | 2:66a4e5d7a7cd | 18 | { |
ikenna1 | 4:740e14ebbc97 | 19 | // initialise the game parameters |
ikenna1 | 2:66a4e5d7a7cd | 20 | _ship_speed = ship_speed; |
ikenna1 | 4:740e14ebbc97 | 21 | _ship_width = ship_width; |
ikenna1 | 4:740e14ebbc97 | 22 | _ship_xpos = ship_xpos; |
ikenna1 | 4:740e14ebbc97 | 23 | _ship_ypos = ship_ypos; |
ikenna1 | 4:740e14ebbc97 | 24 | |
ikenna1 | 3:f9cd1a38d5c6 | 25 | } |
ikenna1 | 4:740e14ebbc97 | 26 | |
ikenna1 | 5:bb6edc5b5be3 | 27 | void RosenEngine::read_input(Gamepad &pad) |
ikenna1 | 4:740e14ebbc97 | 28 | { |
ikenna1 | 4:740e14ebbc97 | 29 | Vector2D mapped_coord = pad.get_coord(); |
ikenna1 | 5:bb6edc5b5be3 | 30 | float _xjoystick = mapped_coord.x; |
ikenna1 | 5:bb6edc5b5be3 | 31 | float _yjoystick = mapped_coord.y; |
ikenna1 | 4:740e14ebbc97 | 32 | } |
ikenna1 | 4:740e14ebbc97 | 33 |