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@4:740e14ebbc97, 2019-03-04 (annotated)
- Committer:
- ikenna1
- Date:
- Mon Mar 04 14:05:00 2019 +0000
- Revision:
- 4:740e14ebbc97
- Parent:
- 3:f9cd1a38d5c6
- Child:
- 5:bb6edc5b5be3
Scraped alot of last changes started adding classes and functions from scratch; ;
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 | 4:740e14ebbc97 | 27 | void PongEngine::read_input(Gamepad &pad) |
ikenna1 | 4:740e14ebbc97 | 28 | { |
ikenna1 | 4:740e14ebbc97 | 29 | Vector2D mapped_coord = pad.get_coord(); |
ikenna1 | 4:740e14ebbc97 | 30 | float x_joystick = mapped_coord.x; |
ikenna1 | 4:740e14ebbc97 | 31 | float y_joystick = mapped_coord.y; |
ikenna1 | 4:740e14ebbc97 | 32 | } |
ikenna1 | 4:740e14ebbc97 | 33 |