forked from loglot-dev/YA2P-FINAL-Beta
-
Notifications
You must be signed in to change notification settings - Fork 1
/
debug.js
181 lines (156 loc) · 4.4 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
export class Debug {
bean = true
noClip = false
playerHitbox = false
freeCam = false
mapBuilder = false
grappleHookTest = true
backGrid = false
shortsMap = false
enum = false
cursorCamera = false
getPos = false
lag = false
extraEnum = false
FPS = true
mute = false
fpsCount = 0
keyManager;
game;
constructor(keyMan, root) {
this.keyManager = keyMan
this.game = root
}
update() {
if (this.keyManager.isKeyPressed("Backslash")) {
this.hideBean()
this.flipNoClip()
this.flipMapMaker()
this.flipGrappleHookTest()
this.flipBackGrid()
//this.flipShortsMap()
this.flipEnum()
this.flipC()
this.flipGP()
this.flipL()
if(this.keyManager.isKeyPressed("ShiftLeft")){
this.flipMouse()
this.flipFPS()
} else{
this.flipPlayerHitbox()
this.flipFreeCam()
}
} else {
this.flipMute()
}
}
flipMute(){
if(this.keyManager.wasKeyJustPressed("KeyM")){
console.log("mute")
this.mute = !this.mute
}
}
flipFPS(){
if(this.keyManager.wasKeyJustPressed("KeyF")){
this.FPS = !this.FPS
}
}
flipMouse(){
if(this.keyManager.wasKeyJustPressed("KeyP")){
document.getElementsByTagName("body")[0].style.cursor = "url('http://wiki-devel.sugarlabs.org/images/e/e2/Arrow.cur'), auto";
}
}
flipL() {
if (this.keyManager.wasKeyJustPressed("KeyL")) {
this.lag = !this.lag
}
}
flipGP() {
if (this.keyManager.wasKeyJustPressed("KeyC")) {
this.getPos = !this.getPos
}
}
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
this.enum = true
} else {
this.grappleHookTest = true
this.noClip = false
this.bean = true
this.enum = false
}
}
}
}
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")) {
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
}
}
}
flipEnum(){
if (this.keyManager.wasKeyJustPressed("KeyE")) {
if(this.keyManager.isKeyPressed("ShiftLeft")) {
this.extraEnum = !this.extraEnum
} else {
this.enum = !this.enum
}
}
}
flipC() {
if (this.keyManager.wasKeyJustPressed("KeyY")) {
this.cursorCamera = !this.cursorCamera
}
}
}