forked from APCSLowell/AsteroidsGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Spaceship.pde
35 lines (35 loc) · 919 Bytes
/
Spaceship.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
34
35
class Spaceship extends Floater
{
public Spaceship() {
corners = 3; //the number of corners, a triangular floater has 3
xCorners = new int[corners];
yCorners = new int[corners];
xCorners[0] = - 8;
yCorners[0] = - 8;
xCorners[1] = 16;
yCorners[1] = 0;
xCorners[2] = -8;
yCorners[2] = 8;
myColor = 225;
myCenterX = 400;
myCenterY = 300; //holds center coordinates
myXspeed = 0;
myYspeed = 0; //holds the speed of travel in the x and y directions
myPointDirection = 0; //holds current direction the ship is pointing in degrees
}
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;
}
}