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

Method constructor

code/main/Teapot.ts:5–33  ·  view source on GitHub ↗
(quest: Quest, pos: Pos)

Source from the content-addressed store, hash-verified

3class Teapot extends QuestEntity{
4 // Constructor
5 constructor(quest: Quest, pos: Pos){
6 super(quest,
7 pos,
8 new Naming("A teapot", "a teapot"),
9 new RenderArea(19, 6),
10 new Pos(0, 0),
11 new CollisionBoxCollection(new CollisionBox(this, new Pos(0, 1), new Pos(3, 1)),
12 new CollisionBox(this, new Pos(6, 1), new Pos(8, 1)),
13 new CollisionBox(this, new Pos(1, 2), new Pos(18, 1)),
14 new CollisionBox(this, new Pos(2, 3), new Pos(17, 1)),
15 new CollisionBox(this, new Pos(3, 4), new Pos(16, 1)),
16 new CollisionBox(this, new Pos(5, 5), new Pos(12, 1))
17 ),
18 new QuestEntityMovement()
19 );
20
21 // Set gravity
22 this.getQuestEntityMovement().setGravity(true);
23 this.getQuestEntityMovement().setWormsLike(true);
24
25 // Set destructible
26 this.setDestructible(true);
27 this.setMaxHp(1000000);
28 this.setHp(1000000);
29
30 // Set the ascii art and the transparent character
31 this.getRenderArea().drawArray(Database.getAscii("places/quests/fortress/teapot"));
32 this.setTransparency(new RenderTransparency(" ", "%"));
33 }
34
35 // update()
36 public update(): void{

Callers

nothing calls this directly

Calls 10

setGravityMethod · 0.80
setWormsLikeMethod · 0.80
setDestructibleMethod · 0.80
drawArrayMethod · 0.80
getAsciiMethod · 0.80
setTransparencyMethod · 0.80
setMaxHpMethod · 0.45
setHpMethod · 0.45
getRenderAreaMethod · 0.45

Tested by

no test coverage detected