forked from APCSLowell/AsteroidsGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bullet.pde
33 lines (29 loc) · 926 Bytes
/
Bullet.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class Bullet extends Floater{
public Bullet(Spaceship spaceship) {
myCenterX = spaceship.getMyCenterX();
myCenterY = spaceship.getMyCenterY(); //holds center coordinates
myXspeed = spaceship.getMyYSpeed();
myYspeed = spaceship.getMyXSpeed(); //holds the speed of travel in the x and y directions
myPointDirection = spaceship.getMyPointDirection(); //holds current direction the ship is pointing in degrees
accelerate(6);
}
public void show() {
fill(128);
ellipse((float)(myCenterX),(float)(myCenterY), 10,10);
}
public double getMyCenterX() {
return myCenterX;
}
public double getMyCenterY() {
return myCenterY;
}
public double getMyPointDirection() {
return myPointDirection;
}
public double getMyXSpeed() {
return myXspeed;
}
public double getMyYSpeed() {
return myYspeed;
}
}