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@5:158e2951654b, 2017-04-30 (annotated)
- Committer:
- el15as
- Date:
- Sun Apr 30 22:51:35 2017 +0000
- Revision:
- 5:158e2951654b
- Parent:
- 4:1f7f32f3e017
- Child:
- 6:33fd1797beb4
Added a switch and a door.; Programmed first three levels.
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 | 5:158e2951654b | 8 | #define OBJECTCOUNT 41 |
| 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 | 5:158e2951654b | 18 | int type; // 0 - Platform, 1 - Horizontal Spikes, 2 - Vertical Spikes, 3 - Door, 4 - Switch |
| 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 | 4:1f7f32f3e017 | 31 | #endif |
| el15as | 4:1f7f32f3e017 | 32 |