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

Method move

code/main/Player.ts:292–301  ·  view source on GitHub ↗
(pos: Pos, force: boolean = false)

Source from the content-addressed store, hash-verified

290 }
291
292 public move(pos: Pos, force: boolean = false): boolean{
293 // Position
294 var posToUse: Pos = pos.copy();
295
296 // If we are wearing the boots of introspection and we would collide by going below, we don't move horizontally and the movement isn't forced
297 if(posToUse.x != 0 && this.game.isEquipped("boots", "eqItemBootsBootsOfIntrospection") && this.checkCollision(new Pos(0, 1)) == true && force == false)
298 posToUse.x = 0;
299
300 return super.move(posToUse, force);
301 }
302
303 public moveWormsLike(pos: Pos): boolean{
304 // Position

Callers 1

squeezeMethod · 0.95

Calls 3

checkCollisionMethod · 0.95
copyMethod · 0.80
isEquippedMethod · 0.80

Tested by

no test coverage detected