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
BulletS/BulletS.cpp@8:86cb9a9f8a73, 2020-03-26 (annotated)
- Committer:
- josh_ohara
- Date:
- Thu Mar 26 15:24:49 2020 +0000
- Revision:
- 8:86cb9a9f8a73
- Parent:
- 7:06a2558155f0
- Child:
- 11:c174d84e4866
6 hours of debugging later.... Have a functioning simple ship
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| josh_ohara | 8:86cb9a9f8a73 | 1 | // #include "BulletS.h" |
| josh_ohara | 2:c2316b659b97 | 2 | |
| josh_ohara | 8:86cb9a9f8a73 | 3 | // Bullet::Bullet() |
| josh_ohara | 8:86cb9a9f8a73 | 4 | // { |
| josh_ohara | 8:86cb9a9f8a73 | 5 | // } |
| josh_ohara | 2:c2316b659b97 | 6 | |
| josh_ohara | 8:86cb9a9f8a73 | 7 | // void Bullet::init(int size, int x) { |
| josh_ohara | 8:86cb9a9f8a73 | 8 | // Size = size; |
| josh_ohara | 8:86cb9a9f8a73 | 9 | // Speed = 0; |
| josh_ohara | 8:86cb9a9f8a73 | 10 | // X = x; //x=Middle of the ship |
| josh_ohara | 8:86cb9a9f8a73 | 11 | // Y = HEIGHT; //y=Top of the ship Height is ship Height |
| josh_ohara | 8:86cb9a9f8a73 | 12 | // } |
| josh_ohara | 2:c2316b659b97 | 13 | |
| josh_ohara | 8:86cb9a9f8a73 | 14 | // void Bullet::draw(N5110 &lcd) |
| josh_ohara | 8:86cb9a9f8a73 | 15 | // { |
| josh_ohara | 8:86cb9a9f8a73 | 16 | // lcd.drawRect(X,Y,Size,Size,FILL_BLACK); |
| josh_ohara | 8:86cb9a9f8a73 | 17 | // } |
| josh_ohara | 8:86cb9a9f8a73 | 18 | // |
| josh_ohara | 8:86cb9a9f8a73 | 19 | // void Bullet::update() { |
| josh_ohara | 8:86cb9a9f8a73 | 20 | // if(pad.A_pressed()) { |
| josh_ohara | 8:86cb9a9f8a73 | 21 | // Speed = 1; //shoots bullet if pad a pressed |
| josh_ohara | 8:86cb9a9f8a73 | 22 | // Y -= Speed; |
| josh_ohara | 8:86cb9a9f8a73 | 23 | // } |
| josh_ohara | 8:86cb9a9f8a73 | 24 | // } |
| josh_ohara | 2:c2316b659b97 | 25 | |
| josh_ohara | 8:86cb9a9f8a73 | 26 | // Vector2D Bullet::get_position() { |
| josh_ohara | 8:86cb9a9f8a73 | 27 | // Vector2D p = {X,Y}; |
| josh_ohara | 8:86cb9a9f8a73 | 28 | // return p; |
| josh_ohara | 8:86cb9a9f8a73 | 29 | // } |
| josh_ohara | 2:c2316b659b97 | 30 | |
| josh_ohara | 4:18a1fc4c38e0 | 31 | //void Bullet::set_hit(bool hit) { |
| josh_ohara | 4:18a1fc4c38e0 | 32 | // bool Hit == hit; |
| josh_ohara | 4:18a1fc4c38e0 | 33 | //} |
| josh_ohara | 4:18a1fc4c38e0 | 34 | |
| josh_ohara | 2:c2316b659b97 | 35 | |
| josh_ohara | 2:c2316b659b97 | 36 | |
| josh_ohara | 2:c2316b659b97 | 37 |