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.
Diff: Mechanics/Mechanics.h
- Revision:
- 6:5f76dd718dc3
- Parent:
- 5:2d9f3c36bcb9
- Child:
- 7:2ce6e90f6d47
--- a/Mechanics/Mechanics.h Tue Feb 11 17:28:56 2020 +0000 +++ b/Mechanics/Mechanics.h Wed Feb 19 21:40:21 2020 +0000 @@ -4,9 +4,14 @@ #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 @@ -41,24 +46,42 @@ 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 class Mechanics { - public: +public: bool Is_Offtrack(Point_2D position, Square_2D offtrack_square[], Triangle_2D offtrack_triangle[], Map_Data map_info); bool Is_Out_Of_Bounds(Point_2D position, Square_2D offtrack_square[], Triangle_2D offtrack_triangle[], Map_Data map_info); int Get_Gate(Square_2D gates[], int number_of_gates, Point_2D position, int current_gate); int Get_Laps(int laps, Square_2D gates[], int number_of_gates, Point_2D position, int current_gate); - - private: + Time Convert_To_Time(int game_fps, int number_of_frames); + float Get_Boost_Speed(Triangle_2D plates[], int number_of_plates, Point_2D position, float speed); + +private: bool Is_Offtrack_Square(Square_2D offtrack[], int size, Point_2D position); bool Is_Offtrack_Triangle(Triangle_2D offtrack[], int size, Point_2D position); bool Is_Out_Of_Bounds_Square(Square_2D out_of_bounds[], int size, Point_2D position); bool Is_Out_Of_Bounds_Triangle(Triangle_2D out_of_bounds[], int size, Point_2D position); - + }; #endif \ No newline at end of file