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
Diff: BulletS/BulletS.cpp
- Revision:
- 6:5bea67cc96f9
- Parent:
- 5:e5bb95fb308b
- Child:
- 7:06a2558155f0
--- a/BulletS/BulletS.cpp Sun Mar 22 19:06:39 2020 +0000
+++ b/BulletS/BulletS.cpp Mon Mar 23 15:20:59 2020 +0000
@@ -4,11 +4,11 @@
{
}
-void Bullet::init(int size, int speed, int Height) {
+void Bullet::init(int size, int x, int y) {
Size = size;
- Speed = speed;
- X = WIDTH/2 - Size/2; //Middle of the ship
- Y = HEIGHT - Height; //Top of the ship Height is ship Height
+ Speed = 0;
+ X = x; //x=Middle of the ship
+ Y = HEIGHT; //y=Top of the ship Height is ship Height
}
void Bullet::draw(N5110 &lcd)
@@ -18,7 +18,7 @@
void Bullet::update() {
if(pad.A_pressed()) {
- Speed = 1; //shoots bullet if pad a pressed
+ Speed = 1; //shoots bullet if pad a pressed
Y -= Speed;
}
}