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

Method constructor

code/main/Monster.ts:8–32  ·  view source on GitHub ↗
(quest: Quest, globalPosition: Pos)

Source from the content-addressed store, hash-verified

6
7 // Constructor
8 constructor(quest: Quest, globalPosition: Pos){
9 // Call the mother constructor
10 super(quest,
11 globalPosition,
12 new Naming("The monster", "the monster"),
13 new RenderArea(13, 4),
14 new Pos(0, 0),
15 new CollisionBoxCollection(new CollisionBox(this, new Pos(0, 0), new Pos(13, 1)),
16 new CollisionBox(this, new Pos(1, 0), new Pos(11, 1)),
17 new CollisionBox(this, new Pos(2, 0), new Pos(9, 1)),
18 new CollisionBox(this, new Pos(3, 0), new Pos(7, 1))),
19 new QuestEntityMovement()
20 );
21
22 // At first, no egg was destroyed
23 this.anEggWasDestroyed = false;
24
25 // Set the ascii art
26 this.getRenderArea().drawArray(Database.getAscii("places/quests/castle/room3/monster"));
27 this.setTransparency(new RenderTransparency(" ", "%"));
28
29 // Set the weapon and its delay
30 this.addQuestEntityWeapon(new QuestEntityWeapon(this.getQuest(), this, new Naming("??", "??"), new CollisionBoxCollection(new CollisionBox(this, new Pos(-1, -1), new Pos(15, 6))), 10000));
31 this.getLastQuestEntityWeapon().getCloseCombatDelay().setFixedDelay(0);
32 }
33
34 // update()
35 public update(): void{

Callers

nothing calls this directly

Calls 9

drawArrayMethod · 0.80
getAsciiMethod · 0.80
setTransparencyMethod · 0.80
addQuestEntityWeaponMethod · 0.80
getQuestMethod · 0.80
setFixedDelayMethod · 0.80
getCloseCombatDelayMethod · 0.80
getRenderAreaMethod · 0.45

Tested by

no test coverage detected