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.
Ghost/Ghost.h
- Committer:
- HenryWTriff
- Date:
- 2020-02-19
- Revision:
- 6:5f76dd718dc3
- Child:
- 7:2ce6e90f6d47
File content as of revision 6:5f76dd718dc3:
#ifndef GHOST_H #define GHOST_H #include "mbed.h" #include "Gamepad.h" #include "N5110.h" #include "FXOS8700CQ.h" #include "Graphics.h" #include "Controls.h" #include "Mechanics.h" #include "Menu.h" #include "LEDs.h" #include "Ghost.h" #include <string> #ifndef STRUCTS #define STRUCTS //STRUCTS struct Point_2D { float x; float y; }; struct Line_2D { Point_2D from; Point_2D to; }; struct Square_2D { Point_2D TL; Point_2D BR; }; struct Triangle_2D { Point_2D TL; Point_2D BR; int Type; }; struct Map_Data { int number_of_track_lines; int number_of_dotted_lines; int number_of_flags; int number_of_walls; int number_of_off_track_squares; int number_of_off_track_triangles; int number_of_out_of_bounds_squares; int number_of_out_of_bounds_triangles; int number_of_gates; int number_of_boost_plates; }; struct Time { int mins; int secs; int milis; }; struct Gyro_Data { float ax; float ay; float az; float mx; float my; float mz; }; #endif static Point_2D Ghost_Data[6000]; static int Ghost_Held_Data_Time = 0; static Point_2D Ghost_Held_Data[6000]; class Ghost { public: void Record(Point_2D position, int race_time); void Copy(int race_time); Point_2D Play(bool ghost_available, int race_time); private: }; #endif