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: GameEngine/engine.h
- Revision:
- 9:dc13042b09f5
- Parent:
- 8:b3738229ba85
- Child:
- 10:b939edd9b87c
--- a/GameEngine/engine.h Sat May 04 22:46:31 2019 +0000
+++ b/GameEngine/engine.h Sun May 05 23:31:07 2019 +0000
@@ -6,7 +6,13 @@
#include "N5110.h"
#include "Gamepad.h"
#include "functions.h"
+#include <vector>
+struct MapSegment {
+
+ float curvature;
+ float meters;
+};
class Engine{
public:
@@ -15,13 +21,20 @@
void init(int screenHeight, int screenWidth, int speed);
void read_input(Gamepad &pad);
- void update(Gamepad &pad, N5110 &lcd);
+ void update(Gamepad &pad, N5110 &lcd, float elapsedTime);
void draw(N5110 &lcd);
void setSpeed(int speed);
private:
- int _speed;
+
+ float _curvature;
+
+ vector<MapSegment> track; // curvature and distance
+
+ float _car_positon;
+ float _distance;
+ float _speed;
int _screen_height;
int _screen_width;