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

Method update

code/main/Demon.ts:73–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71
72 // update()
73 public update(): void{
74 // Try to go towards the player
75 this.goTowards(this.getRenderAreaCenter(), this.getQuest().getGame().getPlayer().getRenderAreaCenter(), 0, new Pos(1, 0));
76
77 // If we're far from the player, we try to jump
78 if(Math.abs(this.getRenderAreaCenter().x - this.getQuest().getGame().getPlayer().getRenderAreaCenter().x) > 5)
79 this.jump(3);
80
81 // Call the mother class update method
82 super.update();
83 }
84
85 // willDie()
86 public willDie(): void{

Callers

nothing calls this directly

Calls 6

goTowardsMethod · 0.80
getRenderAreaCenterMethod · 0.80
getPlayerMethod · 0.80
getQuestMethod · 0.80
getGameMethod · 0.45
jumpMethod · 0.45

Tested by

no test coverage detected