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

Method addPlayerCollisionBoxes

code/main/Quest.ts:87–96  ·  view source on GitHub ↗
(top: boolean, right: boolean, bottom: boolean, left: boolean)

Source from the content-addressed store, hash-verified

85
86 // Public methods
87 public addPlayerCollisionBoxes(top: boolean, right: boolean, bottom: boolean, left: boolean): void{
88 // We remove boxes
89 this.playerCollisionBoxes.removeBoxes();
90
91 // And we re-add them
92 if(top) this.playerCollisionBoxes.addBox(new Pos(-1, -1), new Pos(this.getRealQuestSize().x + 2, 1));
93 if(right) this.playerCollisionBoxes.addBox(new Pos(this.getRealQuestSize().x, -1), new Pos(1, this.getRealQuestSize().y + 2));
94 if(bottom) this.playerCollisionBoxes.addBox(new Pos(-1, this.getRealQuestSize().y), new Pos(this.getRealQuestSize().x + 2, 1));
95 if(left) this.playerCollisionBoxes.addBox(new Pos(-1, -1), new Pos(1, this.getRealQuestSize().y+2));
96 }
97
98 public addEntity(entity: QuestEntity): boolean{
99 // Add the entity

Callers 15

constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80

Calls 3

getRealQuestSizeMethod · 0.95
addBoxMethod · 0.80
removeBoxesMethod · 0.45

Tested by

no test coverage detected