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
Ship/Ship.h@2:c2316b659b97, 2020-03-14 (annotated)
- Committer:
- josh_ohara
- Date:
- Sat Mar 14 20:52:07 2020 +0000
- Revision:
- 2:c2316b659b97
- Child:
- 3:8a140aa1ddcd
Created major folders. Brainstormed some ideas and concluded space invaders. Initial set up of .h and .cpp files for Ship bullets and Ship created.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| josh_ohara | 2:c2316b659b97 | 1 | |
| josh_ohara | 2:c2316b659b97 | 2 | #include Pad.h |
| josh_ohara | 2:c2316b659b97 | 3 | #include mbed.h |
| josh_ohara | 2:c2316b659b97 | 4 | #include N5110.h |
| josh_ohara | 2:c2316b659b97 | 5 | #include Gamepad.h |
| josh_ohara | 2:c2316b659b97 | 6 | |
| josh_ohara | 2:c2316b659b97 | 7 | class Ship |
| josh_ohara | 2:c2316b659b97 | 8 | { |
| josh_ohara | 2:c2316b659b97 | 9 | |
| josh_ohara | 2:c2316b659b97 | 10 | public: |
| josh_ohara | 2:c2316b659b97 | 11 | void init(int y, int height, int width); //dimensions of the ship without shooter, y position is bottom of the screen |
| josh_ohara | 2:c2316b659b97 | 12 | void draw(N5110 &lcd); //Draws basic rectangle ship |
| josh_ohara | 2:c2316b659b97 | 13 | void get_position(); //Returns position of ship |
| josh_ohara | 2:c2316b659b97 | 14 | void update(Direction d,float mag); //Interface between joystick and ship control |
| josh_ohara | 2:c2316b659b97 | 15 | |
| josh_ohara | 2:c2316b659b97 | 16 | private: |
| josh_ohara | 2:c2316b659b97 | 17 | int Height; |
| josh_ohara | 2:c2316b659b97 | 18 | int Width; |
| josh_ohara | 2:c2316b659b97 | 19 | int X; |
| josh_ohara | 2:c2316b659b97 | 20 | int Y; //y value of ship |
| josh_ohara | 2:c2316b659b97 | 21 | int Speed; //speed of ship |
| josh_ohara | 2:c2316b659b97 | 22 | }; |
| josh_ohara | 2:c2316b659b97 | 23 | #endif |