-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLine.pde
More file actions
60 lines (42 loc) · 828 Bytes
/
Copy pathLine.pde
File metadata and controls
60 lines (42 loc) · 828 Bytes
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
/**Creates a paddle*/
class Line extends GameObject
{
int direction;//0:up, 1:left, 2:down, 3:right
Line(int direction)
{
this.direction=direction ;
int z = (int)Z0;
if(mode==GameMode.Saving)
{
z=(int)(Z_HIT_RATIO*Z0);
}
if(direction==0)
{
transform = new Transform(0,-HEIGHT/2,z);
}
if(direction==1)
{
transform = new Transform(-WIDTH/2,0,z);
}
if(direction==2)
{
transform =new Transform(0,HEIGHT/2,z);
}
if(direction==3)
{
transform = new Transform(WIDTH/2,0,z);
}
}
/**Draws the shape of the line in (0,0)*/
void Draw()
{
if(direction%2==0)
{
line(-WIDTH/2,0,WIDTH/2,0);
}
else
{
line(0,-HEIGHT/2,0, HEIGHT/2);
}
}
}