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

Method update

code/main/Mosquito.ts:44–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42
43 // update()
44 public update(): void{
45 // Calculate the distance from the player
46 var distanceFromPlayer: Pos = this.getGlobalPosition().getDistance(this.getQuest().getGame().getPlayer().getGlobalPosition().plus(new Pos(1, 0)));
47
48
49 // Go towards the player
50 this.goTowards(this.getGlobalPosition(), this.getQuest().getGame().getPlayer().getGlobalPosition().plus(new Pos(1, 0)));
51
52
53 // Call the mother class update method
54 super.update();
55 }
56}

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected