-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLinkExiter.java
More file actions
108 lines (99 loc) · 2.74 KB
/
LinkExiter.java
File metadata and controls
108 lines (99 loc) · 2.74 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
99
100
101
102
103
104
105
106
107
108
/**
* @(#)GraphicalStuff.java
*
*
* @author
* @version 1.00 2012/3/19
*/
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.lang.Math;
public class LinkExiter implements Runnable{
public Link link;
public LinkExiter(Link theLink) {
this.link = theLink;
}
//@Override
public void run(){
while (1>0){
if (this.link.direction.equals("u")){
if (this.link.linkCo[1] < 5){
this.link.linkExit = "u";
//this.link.window.theMap.mapErase();
for (int i = 0; i < 10; i++){
if (this.link.window.theMonster[i] != null){
this.link.window.theMonster[i].HP = 0;
}
}
}
}
else if (this.link.direction.equals("d")){
if (this.link.linkCo[1] > 335){
this.link.linkExit = "d";
//this.link.window.theMap.mapErase();
for (int i = 0; i < 10; i++){
if (this.link.window.theMonster[i] != null){
this.link.window.theMonster[i].HP = 0;
}
}
}
}
else if (this.link.direction.equals("l")){
if (this.link.linkCo[0] < 5){
this.link.linkExit = "l";
//this.link.window.theMap.mapErase();
for (int i = 0; i < 10; i++){
if (this.link.window.theMonster[i] != null){
this.link.window.theMonster[i].HP = 0;
}
}
}
}
else if (this.link.direction.equals("r")){
if (this.link.linkCo[0] > 505){
this.link.linkExit = "r";
//this.link.window.theMap.mapErase();
for (int i = 0; i < 10; i++){
if (this.link.window.theMonster[i] != null){
this.link.window.theMonster[i].HP = 0;
}
}
}
}
if (this.link.direction.equals("u")){
if (this.link.linkCo[1] < - 44){
this.link.linkCo[1] = 384;
this.link.window.theMap.y = this.link.window.theMap.y - 1;
this.link.window.theMap.mapLoad(this.link.window.theMap.x, this.link.window.theMap.y);
}
}
else if (this.link.direction.equals("d")){
if (this.link.linkCo[1] > 384){
this.link.linkCo[1] = -44;
this.link.window.theMap.y = this.link.window.theMap.y + 1;
this.link.window.theMap.mapLoad(this.link.window.theMap.x, this.link.window.theMap.y);
}
}
else if (this.link.direction.equals("l")){
if (this.link.linkCo[0] < -44){
this.link.linkCo[0] = 554;
this.link.window.theMap.x = this.link.window.theMap.x - 1;
this.link.window.theMap.mapLoad(this.link.window.theMap.x, this.link.window.theMap.y);
}
}
else if (this.link.direction.equals("r")){
if (this.link.linkCo[0] > 554){
this.link.linkCo[0] = -44;
this.link.window.theMap.x = this.link.window.theMap.x + 1;
this.link.window.theMap.mapLoad(this.link.window.theMap.x, this.link.window.theMap.y);
}
}
try{
Thread.sleep(5);
}
catch (InterruptedException e){
}
}
}
}