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

Method checkCollision

code/main/Player.ts:59–69  ·  view source on GitHub ↗
(pos: Pos = new Pos(0, 0))

Source from the content-addressed store, hash-verified

57 }
58
59 public checkCollision(pos: Pos = new Pos(0, 0)): boolean{
60 // If our mother class detects a collision, we return true
61 if(super.checkCollision(pos) == true)
62 return true;
63
64 // We also try collisions with the special player collision boxes
65 if(this.collidesWith(this.getQuest().getPlayerCollisionBoxes(), pos))
66 return true;
67
68 return false;
69 }
70
71 public getCharacterType(): PlayerCharacterType{
72 return this.characterType;

Callers 5

moveMethod · 0.95
moveWormsLikeMethod · 0.95
squeezeMethod · 0.95
addEntityMethod · 0.45
handleUpDownMovementMethod · 0.45

Calls 3

getQuestMethod · 0.80
collidesWithMethod · 0.45

Tested by

no test coverage detected