-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.js
More file actions
34 lines (29 loc) · 746 Bytes
/
debug.js
File metadata and controls
34 lines (29 loc) · 746 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
import { WrappedSnuok } from 'snuok';
export class ScriptedSnuok extends WrappedSnuok {
constructor(app, start, len, speed, script) {
super(app, start, len, speed);
this.script = script;
this.scriptPos = 0;
}
stateTick() {
super.stateTick();
this.execute(this.script[this.scriptPos]);
this.scriptPos += 1;
this.scriptPos %= this.script.length;
}
bindKeys() {}
execute(command) {
if (command === 'up') {
this.UP();
}
if (command === 'down') {
this.DOWN();
}
if (command === 'left') {
this.LEFT();
}
if (command === 'right') {
this.RIGHT();
}
}
}