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
GameObject/GameObject.h@6:33fd1797beb4, 2017-05-01 (annotated)
- Committer:
- el15as
- Date:
- Mon May 01 22:47:46 2017 +0000
- Revision:
- 6:33fd1797beb4
- Parent:
- 5:158e2951654b
- Child:
- 8:c3cf8d1057bb
Levels 4 and 5 added; Coin physics programmed
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| el15as | 4:1f7f32f3e017 | 1 | #ifndef GAMEOBJECT_H | 
| el15as | 4:1f7f32f3e017 | 2 | #define GAMEOBJECT_H | 
| el15as | 4:1f7f32f3e017 | 3 | |
| el15as | 4:1f7f32f3e017 | 4 | #include "mbed.h" | 
| el15as | 4:1f7f32f3e017 | 5 | #include "N5110.h" | 
| el15as | 4:1f7f32f3e017 | 6 | #include "Gamepad.h" | 
| el15as | 4:1f7f32f3e017 | 7 | |
| el15as | 6:33fd1797beb4 | 8 | #define OBJECTCOUNT 51 | 
| el15as | 4:1f7f32f3e017 | 9 | |
| el15as | 4:1f7f32f3e017 | 10 | class GameObject | 
| el15as | 4:1f7f32f3e017 | 11 | { | 
| el15as | 4:1f7f32f3e017 | 12 | |
| el15as | 4:1f7f32f3e017 | 13 | public: | 
| el15as | 4:1f7f32f3e017 | 14 | |
| el15as | 4:1f7f32f3e017 | 15 | GameObject(); | 
| el15as | 4:1f7f32f3e017 | 16 | ~GameObject(); | 
| el15as | 4:1f7f32f3e017 | 17 | |
| el15as | 6:33fd1797beb4 | 18 | int type; // 0 - Platform, 1 - Horizontal Spikes, 2 - Vertical Spikes, 3 - Door, 4 - Switch, 5 - Uncollected Coin, 6 - Collected Coin | 
| el15as | 5:158e2951654b | 19 | intVector2D position; // Top-left corner of the cube | 
| el15as | 4:1f7f32f3e017 | 20 | int width; | 
| el15as | 4:1f7f32f3e017 | 21 | int height; | 
| el15as | 4:1f7f32f3e017 | 22 | |
| el15as | 4:1f7f32f3e017 | 23 | bool containsPoint(int x, int y); | 
| el15as | 4:1f7f32f3e017 | 24 | |
| el15as | 4:1f7f32f3e017 | 25 | private: | 
| el15as | 4:1f7f32f3e017 | 26 | |
| el15as | 4:1f7f32f3e017 | 27 | bool containsX(int _x); | 
| el15as | 4:1f7f32f3e017 | 28 | bool containsY(int _y); | 
| el15as | 4:1f7f32f3e017 | 29 | |
| el15as | 4:1f7f32f3e017 | 30 | }; | 
| el15as | 6:33fd1797beb4 | 31 | #endif |