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
Objects/Object.h@32:84e79aa7858c, 2020-05-16 (annotated)
- Committer:
- el19tb
- Date:
- Sat May 16 05:22:26 2020 +0000
- Revision:
- 32:84e79aa7858c
- Parent:
- 31:70521f37e004
- Child:
- 38:a6e040bf0e35
setup car speed, redid vehicle rows, dir, type, refactored code as well
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el19tb | 31:70521f37e004 | 1 | #ifndef OBJECT_H |
| el19tb | 31:70521f37e004 | 2 | #define OBJECT_H |
| el19tb | 31:70521f37e004 | 3 | |
| el19tb | 31:70521f37e004 | 4 | // holds information about object |
| el19tb | 31:70521f37e004 | 5 | struct ObjectInfo |
| el19tb | 31:70521f37e004 | 6 | { |
| el19tb | 31:70521f37e004 | 7 | float x; // x pos |
| el19tb | 31:70521f37e004 | 8 | int y; // y pos |
| el19tb | 31:70521f37e004 | 9 | int dir; // direction of object |
| el19tb | 31:70521f37e004 | 10 | char c; // type of object |
| el19tb | 31:70521f37e004 | 11 | }; |
| el19tb | 31:70521f37e004 | 12 | |
| el19tb | 31:70521f37e004 | 13 | // keeps track of functions related to Objects |
| el19tb | 31:70521f37e004 | 14 | class Object |
| el19tb | 31:70521f37e004 | 15 | { |
| el19tb | 31:70521f37e004 | 16 | public: |
| el19tb | 31:70521f37e004 | 17 | |
| el19tb | 31:70521f37e004 | 18 | Object(); |
| el19tb | 31:70521f37e004 | 19 | |
| el19tb | 31:70521f37e004 | 20 | int slow; |
| el19tb | 31:70521f37e004 | 21 | int medium; |
| el19tb | 31:70521f37e004 | 22 | int fast; |
| el19tb | 31:70521f37e004 | 23 | |
| el19tb | 32:84e79aa7858c | 24 | int row; |
| el19tb | 32:84e79aa7858c | 25 | |
| el19tb | 31:70521f37e004 | 26 | int screenWidth; |
| el19tb | 31:70521f37e004 | 27 | int screenHeight; |
| el19tb | 31:70521f37e004 | 28 | |
| el19tb | 31:70521f37e004 | 29 | ObjectInfo object; |
| el19tb | 31:70521f37e004 | 30 | |
| el19tb | 31:70521f37e004 | 31 | public: |
| el19tb | 31:70521f37e004 | 32 | |
| el19tb | 31:70521f37e004 | 33 | void setRow(int row); |
| el19tb | 31:70521f37e004 | 34 | void setSeperation(int seperation); |
| el19tb | 31:70521f37e004 | 35 | void setSprite(char type); |
| el19tb | 31:70521f37e004 | 36 | |
| el19tb | 31:70521f37e004 | 37 | }; |
| el19tb | 31:70521f37e004 | 38 | |
| el19tb | 31:70521f37e004 | 39 | #endif |