-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMultiPress.java
81 lines (70 loc) · 2.22 KB
/
MultiPress.java
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
public class MultiPress extends Thread implements Runnable
{
DrawPanel d;
public MultiPress(DrawPanel d)
{
this.d=d;
}
public void run()
{
while(!d.currentKeys.isEmpty())
try{
if(d.currentKeys.contains("T")&&d.currentKeys.contains("F"))
{
this.sleep(3);
d.globalY+=3;
if(d.globalX<=-3)
d.globalX+=3;
else if(d.globalX!=0)
d.globalX=0;
}
else if(d.currentKeys.contains("T")&&d.currentKeys.contains("H"))
{
this.sleep(3);
d.globalY+=3;
d.globalX-=3;
}
else if(d.currentKeys.contains("G")&&d.currentKeys.contains("F"))
{
this.sleep(3);
d.globalY-=3;
if(d.globalX<=-3)
d.globalX+=3;
else if(d.globalX!=0)
d.globalX=0;
}
else if(d.currentKeys.contains("G")&&d.currentKeys.contains("H"))
{
this.sleep(3);
d.globalY-=3;
d.globalX-=3;
}
else if(d.currentKeys.contains("T"))
{
this.sleep(3);
d.globalY+=3;
}
else if(d.currentKeys.contains("G"))
{
this.sleep(3);
d.globalY-=3;
}
else if(d.currentKeys.contains("F"))
{
this.sleep(3);
if(d.globalX<=-3)
d.globalX+=3;
else if(d.globalX!=0)
d.globalX=0;
}
else if(d.currentKeys.contains("H"))
{
this.sleep(3);
d.globalX-=3;
}
}
catch(Exception e)
{
}
}
}