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 Class Reference
#include <Ghost.h>
Public Member Functions | |
| Ghost () | |
| Constructor. | |
| ~Ghost () | |
| Destructor. | |
| void | SD_init (SDFileSystem &SD, N5110 &LCD) |
| Formats the SD card with the correct text files and fills them with temporary data. | |
| void | SD_Read (int track, int car, SDFileSystem &SD) |
| Copies the ghost data int the txt file associated with the track-car combination to RAM. | |
| void | Record (Point_2D position, int race_time) |
| Adds the current position of the car to a Ghost_Data array. | |
| void | Copy (int race_time, int track, int car, SDFileSystem &SD) |
| If the race that was just run was faster than previos races, this copies the data in the Ghost_Data array to the SD card. | |
| Point_2D | Play (bool ghost_available, int race_time) |
| Returns the position of the ghost for a given race_time. | |
Detailed Description
Ghost Class.
Records the current position of the player so that it can be played back later during ghost mode. The best race (so far) is copied to the SD card when the race is over. Before each race, the previos best ghost data is read from the SD card to internal memory to allow the game to run faster.
- Date:
- Mar, 2020
Definition at line 97 of file Ghost.h.
Constructor & Destructor Documentation
Member Function Documentation
| void Copy | ( | int | race_time, |
| int | track, | ||
| int | car, | ||
| SDFileSystem & | SD | ||
| ) |
If the race that was just run was faster than previos races, this copies the data in the Ghost_Data array to the SD card.
- Parameters:
-
race_time The number of frames elapsed during race track The user selected track (int) car The user selected car (int) SD The object for the SDFileSystem class (object)
| Point_2D Play | ( | bool | ghost_available, |
| int | race_time | ||
| ) |
| void Record | ( | Point_2D | position, |
| int | race_time | ||
| ) |
| void SD_init | ( | SDFileSystem & | SD, |
| N5110 & | LCD | ||
| ) |
Formats the SD card with the correct text files and fills them with temporary data.
- Parameters:
-
SD The object for the SDFileSystem class (object).
| void SD_Read | ( | int | track, |
| int | car, | ||
| SDFileSystem & | SD | ||
| ) |
Copies the ghost data int the txt file associated with the track-car combination to RAM.
- Parameters:
-
track The user selected track (int) car The user selected car (int) SD The object for the SDFileSystem class (object)
Generated on Wed Jul 20 2022 17:42:24 by
1.7.2