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

Method update

code/main/Chest.ts:49–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47
48 // update()
49 public update(): void{
50 super.update();
51
52 // If the chest isn't opened yet
53 if(this.isOpened == false){
54 // If the player has a collision box collection
55 if(this.getQuest().getGame().getPlayer().getCbc() != null){
56 // If it collides with our opening collision box collection
57 if(this.getQuest().getGame().getPlayer().getCbc().collidesWith(this.openingCollisionBoxCollection)){
58 // We are now opened
59 this.isOpened = true;
60 // We fire the callback collection
61 this.callbackCollection.fire();
62 // We re-draw
63 this.drawChestAscii();
64 }
65 }
66 }
67 }
68
69 // Private methods
70 private drawChestAscii(): void{

Callers

nothing calls this directly

Calls 7

drawChestAsciiMethod · 0.95
getCbcMethod · 0.80
getPlayerMethod · 0.80
getQuestMethod · 0.80
fireMethod · 0.65
getGameMethod · 0.45
collidesWithMethod · 0.45

Tested by

no test coverage detected