forked from loglot/yet-another-2d-platformer-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebug.js
110 lines (96 loc) · 2.75 KB
/
debug.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
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
109
110
export class Debug {
bean = true
noClip = false
playerHitbox = false
freeCam = false
mapBuilder = false
grappleHookTest = true
backGrid = false
shortsMap = false
keyManager;
game;
constructor(keyMan, root) {
this.keyManager = keyMan
this.game = root
}
update() {
if (this.keyManager.isKeyPressed("Backslash")) {
this.hideBean()
this.flipNoClip()
this.flipPlayerHitbox()
this.flipFreeCam()
this.flipMapMaker()
this.flipGrappleHookTest()
this.flipBackGrid()
this.flipShortsMap()
}
}
hideBean() {
if (this.keyManager.wasKeyJustPressed("KeyH")) {
console.log("hide")
this.bean = !this.bean
}
}
flipNoClip() {
if (this.keyManager.wasKeyJustPressed("KeyN")) {
console.log("noClip")
this.noClip = !this.noClip
}
}
flipPlayerHitbox() {
if (this.keyManager.wasKeyJustPressed("KeyP")) {
console.log("playerHitbox")
this.playerHitbox = !this.playerHitbox
}
}
flipFreeCam() {
if (this.keyManager.wasKeyJustPressed("KeyF")) {
console.log("free Camera")
this.freeCam = !this.freeCam
}
}
flipMapMaker() {
if (this.keyManager.wasKeyJustPressed("KeyM")) {
console.log("map editor")
this.mapBuilder = !this.mapBuilder
if (this.keyManager.isKeyPressed("ShiftLeft")) {
if (this.mapBuilder == true) {
this.grappleHookTest = false
this.noClip = true
this.bean = false
} else {
this.grappleHookTest = true
this.noClip = false
this.bean = true
}
}
}
}
flipBackGrid() {
if (this.keyManager.wasKeyJustPressed("KeyB")) {
console.log("grid")
this.backGrid = !this.backGrid
}
}
flipGrappleHookTest() {
if (this.keyManager.wasKeyJustPressed("KeyG")) {
console.log("Grapple")
this.grappleHookTest = !this.grappleHookTest
}
}
flipShortsMap(){
if (this.keyManager.wasKeyJustPressed("KeyS")) {
console.log("YT SHORTS")
this.shortsMap = !this.shortsMap
if(this.shortsMap == true) {
this.game.map.shorts()
this.game.player.x = -438
this.game.player.y = -459
} else {
this.game.map.Main()
this.game.player.x = -438
this.game.player.y = -509
}
}
}
}