-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActionTrigger.js
53 lines (36 loc) · 1003 Bytes
/
ActionTrigger.js
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
class ActionTrigger extends LevelObject {
constructor(index, x, y, width, height, mode, action) {
super(null, x, y, width, height, mode);
this.index = index;
this.action = action;
}
manageTrigger() {
if (this.isInteracting(player)) {
switch (this.action) {
case LANDING :
this.isActing = true;
break;
case TEXT :
this.isActing = true;
break;
case CHECK_POINT :
player.checkPointX = this.checkPointX;
player.checkPointY = this.checkPointY;
}
}
if (this.isActing) {
this.executeAction();
}
}
executeAction() {
switch (this.action) {
}
}
remove() {
clickAction = null;
world.removeActionTrigger(this.index);
}
exit() {
this.remove();
}
}