MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / move

Method move

code/main/TheCave.ts:259–277  ·  view source on GitHub ↗
(type: TheCaveMoveType)

Source from the content-addressed store, hash-verified

257 }
258
259 private move(type: TheCaveMoveType): void{
260 // If we made more than 12 moves and there's no pattern, we reach the exit
261 if(this.lastMoves.length > 12 && this.pattern == null){
262 this.goToTheCaveExit();
263 }
264
265 // If there's a pattern, we call its move method
266 if(this.pattern != null) this.pattern.move(type);
267
268 // Add this move to the last moves
269 this.lastMoves.push(type);
270
271 // Create the new way
272 this.createWay(type);
273
274 // Update
275 this.update();
276 this.getGame().updatePlace();
277 }
278
279 private update(): void{
280 // Erase everything

Callers

nothing calls this directly

Calls 5

goToTheCaveExitMethod · 0.95
createWayMethod · 0.95
updateMethod · 0.95
updatePlaceMethod · 0.80
getGameMethod · 0.45

Tested by

no test coverage detected