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

Method constructor

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

Source from the content-addressed store, hash-verified

6
7 // Constructor
8 constructor(game: Game){
9 super(game);
10
11 // Resize the quest
12 this.resizeQuest(100, 30);
13
14 // Add collision boxes around
15 this.addPlayerCollisionBoxes(true, true, true, true);
16
17 // Add the player
18 this.getGame().getPlayer().loadCandyBoxCharacter(this);
19 this.getGame().getPlayer().setGlobalPosition(new Pos(97, 23));
20 this.configPlayerOrClone(this.getGame().getPlayer());
21 this.addEntity(this.getGame().getPlayer());
22
23 // Add the walls
24 this.addWalls();
25
26 // Add the eggs
27 this.addEggs();
28
29 // Add the monster
30 this.addMonster();
31
32 // Add the chest
33 this.addChest();
34
35 // Add the message
36 this.getGame().getQuestLog().addMessage(new QuestLogMessage("You enter one of the castle's room."));
37 }
38
39 // Public methods
40 public castPlayerTeleport(): void{

Callers

nothing calls this directly

Calls 14

configPlayerOrCloneMethod · 0.95
addWallsMethod · 0.95
addEggsMethod · 0.95
addMonsterMethod · 0.95
addChestMethod · 0.95
resizeQuestMethod · 0.80
loadCandyBoxCharacterMethod · 0.80
getPlayerMethod · 0.80
setGlobalPositionMethod · 0.80
addEntityMethod · 0.80
addMessageMethod · 0.80

Tested by

no test coverage detected