forked from APCSLowell/AsteroidsGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBolt.pde
31 lines (31 loc) · 1.01 KB
/
Bolt.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
public class Bolt extends Floater
{
public Bolt()
{
yCorners=new int[]{-2,2,2,-2};
xCorners=new int[]{20,20,-20,-20};
corners=4;
myColor=color(57,255,20);
myCenterX=ship.getX();
myCenterY=ship.getY();
myDirectionX=ship.getDirectionX();
myDirectionY=ship.getDirectionY();
myPointDirection=ship.getPointDirection();
accelerate(25);
}
public void setX(int x){myCenterX=x;}
public int getX(){return (int)myCenterX;}
public void setY(int y){myCenterY=y;}
public int getY(){return (int)myCenterY;}
public void setDirectionX(double x){myDirectionX=x;}
public double getDirectionX(){return myDirectionX;}
public void setDirectionY(double y){myDirectionY=y;}
public double getDirectionY(){return myDirectionY;}
public void setPointDirection(int degrees){myPointDirection=degrees;}
public double getPointDirection(){return myPointDirection;}
public void move()
{
myCenterX += myDirectionX;
myCenterY += myDirectionY;
}
}