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

Method constructor

code/main/Cellar.ts:7–32  ·  view source on GitHub ↗
(game: Game)

Source from the content-addressed store, hash-verified

5class Cellar extends Quest{
6 // Constructor
7 constructor(game: Game){
8 super(game);
9
10 // Resize the quest
11 this.resizeQuest(100, 3);
12
13 // Add collision boxes around
14 this.addPlayerCollisionBoxes(true, false, true, true);
15
16 // Add the player
17 this.getGame().getPlayer().loadCandyBoxCharacter(this);
18 this.getGame().getPlayer().setGlobalPosition(new Pos(0, 2));
19 this.getGame().getPlayer().setQuestEntityMovement(new QuestEntityMovement(new Pos(1, 0)));
20 this.getGame().getPlayer().getQuestEntityMovement().setGravity(true);
21 this.getGame().getPlayer().getQuestEntityMovement().setWormsLike(false);
22 this.addEntity(this.getGame().getPlayer());
23
24 // Add the ground
25 this.addGround();
26
27 // Add the rats
28 this.addRats();
29
30 // Add a delimiter and the message
31 this.getGame().getQuestLog().addMessage(new QuestLogMessage("You enter the cellar. It's dark and you hear rats squeaking all around you."));
32 }
33
34 // Public methods
35 public endQuest(win: boolean): void{

Callers

nothing calls this directly

Calls 15

addGroundMethod · 0.95
addRatsMethod · 0.95
resizeQuestMethod · 0.80
loadCandyBoxCharacterMethod · 0.80
getPlayerMethod · 0.80
setGlobalPositionMethod · 0.80
setGravityMethod · 0.80
setWormsLikeMethod · 0.80
addEntityMethod · 0.80

Tested by

no test coverage detected