-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLaser.java
More file actions
98 lines (81 loc) · 1.66 KB
/
Laser.java
File metadata and controls
98 lines (81 loc) · 1.66 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import javafx.scene.layout.* ;
import javafx.scene.shape.*;
import javafx.scene.paint.*;
public class Laser
{
private double x, y, width, height ;
private String dir ;
private Rectangle rect ;
private Pane pane ;
public Laser(double tempX, double tempY, double tempWidth, double tempHeight, Pane tempPane)
{
this.x = tempX ;
this.y = tempY ;
this.width = tempWidth ;
this.height = tempHeight ;
this.pane = tempPane ;
rect = new Rectangle() ;
rect.setX(this.x) ;
rect.setY(this.y) ;
rect.setWidth(this.width) ;
rect.setHeight(this.height) ;
rect.setFill(Color.YELLOW) ;
this.pane.getChildren().add(rect) ;
}
public void destroy()
{
this.pane.getChildren().remove(this.rect) ;
}
public BoundingBox getBoundingBox()
{
return new BoundingBox(this.x, this.y, this.width, this.height) ;
}
public Double getX()
{
return this.x ;
}
public Double getY()
{
return this.y ;
}
public Double getWidth()
{
return this.width ;
}
public Double getHeight()
{
return this.height ;
}
public Pane getPane()
{
return this.pane ;
}
public String getDirection()
{
return this.dir ;
}
public void setX(double tempX)
{
this.x = tempX ;
rect.setX(this.x) ;
}
public void setY(double tempY)
{
this.y = tempY ;
rect.setY(this.y) ;
}
public void setWidth(double tempWidth)
{
this.width = tempWidth ;
rect.setWidth(this.width) ;
}
public void setHeight(double tempHeight)
{
this.height = tempHeight ;
rect.setHeight(this.height) ;
}
public void setDirection(String temp)
{
this.dir = temp.toUpperCase() ;
}
}