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

Method update

code/main/Monster.ts:35–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33
34 // update()
35 public update(): void{
36 // If no egg was destroyed, we go towards the player but we stay on the roof
37 if(this.anEggWasDestroyed == false){
38 this.goTowards(this.getGlobalPosition().plus(new Pos(6, 4)), this.getQuest().getGame().getPlayer().getGlobalPosition().plus(new Pos(1, 0)), 0, new Pos(2, 0), true);
39 }
40 // Else, we go down on the player
41 else{
42 this.goTowards(this.getGlobalPosition().plus(new Pos(6, 4)), this.getQuest().getGame().getPlayer().getGlobalPosition().plus(new Pos(1, 0)), 0, new Pos(4, 4));
43 }
44
45 // Call the mother classe update
46 super.update();
47 }
48
49 // Public methods
50 public eggDestroyed(): void{

Callers

nothing calls this directly

Calls 6

goTowardsMethod · 0.80
plusMethod · 0.80
getGlobalPositionMethod · 0.80
getPlayerMethod · 0.80
getQuestMethod · 0.80
getGameMethod · 0.45

Tested by

no test coverage detected