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.
lib/Barrel/Barrel.h@19:8400ecdb69e9, 2019-05-08 (annotated)
- Committer:
- Kern_EL17KJTF
- Date:
- Wed May 08 23:14:49 2019 +0000
- Revision:
- 19:8400ecdb69e9
- Parent:
- 18:80c47cfe9802
- Child:
- 25:0ba3524ee0b7
Documentation - Controls Class Complete.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kern_EL17KJTF | 10:28575a6eaa13 | 1 | #ifndef BARREL_H |
Kern_EL17KJTF | 10:28575a6eaa13 | 2 | #define BARREL_H |
Kern_EL17KJTF | 10:28575a6eaa13 | 3 | |
Kern_EL17KJTF | 10:28575a6eaa13 | 4 | #include "mbed.h" |
Kern_EL17KJTF | 10:28575a6eaa13 | 5 | #include "N5110.h" |
Kern_EL17KJTF | 10:28575a6eaa13 | 6 | #include "Barrel.h" |
Kern_EL17KJTF | 10:28575a6eaa13 | 7 | #include "Donkey.h" |
Kern_EL17KJTF | 10:28575a6eaa13 | 8 | |
Kern_EL17KJTF | 18:80c47cfe9802 | 9 | /** External variables used inside and out of the class. */ |
Kern_EL17KJTF | 18:80c47cfe9802 | 10 | extern int barrel_x; |
Kern_EL17KJTF | 18:80c47cfe9802 | 11 | extern int barrel_y; |
Kern_EL17KJTF | 18:80c47cfe9802 | 12 | extern int barrel_speed; |
Kern_EL17KJTF | 18:80c47cfe9802 | 13 | extern int barrel_min; |
Kern_EL17KJTF | 18:80c47cfe9802 | 14 | extern int barrel_max; |
Kern_EL17KJTF | 18:80c47cfe9802 | 15 | extern float barrel_time; |
Kern_EL17KJTF | 18:80c47cfe9802 | 16 | extern int running; |
Kern_EL17KJTF | 18:80c47cfe9802 | 17 | |
Kern_EL17KJTF | 18:80c47cfe9802 | 18 | /** Barrel Class |
Kern_EL17KJTF | 18:80c47cfe9802 | 19 | *@brief This class is for spawning the barrel, it will float down the screen. Collision with the player will cause gameover. |
Kern_EL17KJTF | 18:80c47cfe9802 | 20 | *@author Kern Fowler |
Kern_EL17KJTF | 18:80c47cfe9802 | 21 | *@version 1.0 |
Kern_EL17KJTF | 18:80c47cfe9802 | 22 | *@date May 2019 |
Kern_EL17KJTF | 18:80c47cfe9802 | 23 | */ |
Kern_EL17KJTF | 11:b288d01533cc | 24 | |
Kern_EL17KJTF | 18:80c47cfe9802 | 25 | class Barrel { |
Kern_EL17KJTF | 10:28575a6eaa13 | 26 | |
Kern_EL17KJTF | 18:80c47cfe9802 | 27 | public: |
Kern_EL17KJTF | 18:80c47cfe9802 | 28 | /** Barrel Constructor |
Kern_EL17KJTF | 19:8400ecdb69e9 | 29 | @brief Builds my default Barrel constructor. |
Kern_EL17KJTF | 18:80c47cfe9802 | 30 | @details This does not have any setup. |
Kern_EL17KJTF | 18:80c47cfe9802 | 31 | */ |
Kern_EL17KJTF | 18:80c47cfe9802 | 32 | Barrel(); |
Kern_EL17KJTF | 18:80c47cfe9802 | 33 | /** Barrel Destructor |
Kern_EL17KJTF | 18:80c47cfe9802 | 34 | @brief Builds my default Barrel dentructor. |
Kern_EL17KJTF | 18:80c47cfe9802 | 35 | @details This does not have any setup. |
Kern_EL17KJTF | 18:80c47cfe9802 | 36 | */ |
Kern_EL17KJTF | 18:80c47cfe9802 | 37 | ~Barrel(); |
Kern_EL17KJTF | 18:80c47cfe9802 | 38 | // Mutators |
Kern_EL17KJTF | 10:28575a6eaa13 | 39 | |
Kern_EL17KJTF | 18:80c47cfe9802 | 40 | /** |
Kern_EL17KJTF | 18:80c47cfe9802 | 41 | *@brief Spawns the barrel |
Kern_EL17KJTF | 18:80c47cfe9802 | 42 | *@param pad The Gamepad class is used. |
Kern_EL17KJTF | 18:80c47cfe9802 | 43 | *@param lcd The N5110 class is used. |
Kern_EL17KJTF | 18:80c47cfe9802 | 44 | *@param dky The Donkey class is used. |
Kern_EL17KJTF | 18:80c47cfe9802 | 45 | *@details Spawns a barrel at a random x location, then slowly falls down screen. When reaches bottom it restarts. If collision with player leads to gameover. |
Kern_EL17KJTF | 18:80c47cfe9802 | 46 | */ |
Kern_EL17KJTF | 18:80c47cfe9802 | 47 | void barrel_drop(Gamepad &pad, N5110 &lcd, Donkey &dky); |
Kern_EL17KJTF | 10:28575a6eaa13 | 48 | }; |
Kern_EL17KJTF | 10:28575a6eaa13 | 49 | |
Kern_EL17KJTF | 10:28575a6eaa13 | 50 | #endif |