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

Method constructor

code/main/Yourself.ts:14–37  ·  view source on GitHub ↗
(game: Game)

Source from the content-addressed store, hash-verified

12
13 // Constructor
14 constructor(game: Game){
15 super(game);
16
17 // Resize the quest
18 this.resizeQuest(100, 20);
19
20 // Add collision boxes around
21 this.addPlayerCollisionBoxes(true, true, true, true);
22
23 // Add the player
24 this.getGame().getPlayer().loadCandyBoxCharacter(this);
25 this.getGame().getPlayer().setGlobalPosition(new Pos(0, 19));
26 this.configPlayerOrClone(this.getGame().getPlayer());
27 this.addEntity(this.getGame().getPlayer());
28
29 // Add yourself
30 this.addYourself();
31
32 // Add the walls
33 this.addWalls();
34
35 // Add the message
36 this.getGame().getQuestLog().addMessage(new QuestLogMessage("You are now fighting yourself."));
37 }
38
39 // Public methods
40 public configPlayerOrClone(entity: QuestEntity): void{

Callers

nothing calls this directly

Calls 12

configPlayerOrCloneMethod · 0.95
addYourselfMethod · 0.95
addWallsMethod · 0.95
resizeQuestMethod · 0.80
loadCandyBoxCharacterMethod · 0.80
getPlayerMethod · 0.80
setGlobalPositionMethod · 0.80
addEntityMethod · 0.80
addMessageMethod · 0.80
getQuestLogMethod · 0.80
getGameMethod · 0.45

Tested by

no test coverage detected