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

Method loadMediumCharacter

code/main/Player.ts:240–260  ·  view source on GitHub ↗
(quest: Quest, firstTime: boolean = true)

Source from the content-addressed store, hash-verified

238 }
239
240 public loadMediumCharacter(quest: Quest, firstTime: boolean = true): void{
241 // Set the type
242 this.characterType = PlayerCharacterType.MEDIUM;
243
244 // Load stuff common to all characters if it's the first time we load the character in this quest
245 if(firstTime) this.loadCharacter(quest);
246
247 // Set the ascii representation (size + what it looks like)
248 this.setRenderArea(new RenderArea(11, 4));
249 this.drawOnRenderArea();
250
251 // Set the collision boxes
252 this.setCbc(new CollisionBoxCollection(new CollisionBox(this, new Pos(0, 0), new Pos(11, 1)),
253 new CollisionBox(this, new Pos(1, 1), new Pos(9, 1)),
254 new CollisionBox(this, new Pos(2, 2), new Pos(7, 1)),
255 new CollisionBox(this, new Pos(4, 3), new Pos(3, 1))
256 ));
257
258 // Transparent character
259 this.setTransparency(new RenderTransparency(" ", "%"));
260 }
261
262 public loadMediumSqueezedCharacter(quest: Quest, firstTime: boolean = true): void{
263 // Set the type

Callers 2

squeezeMethod · 0.95
constructorMethod · 0.80

Calls 5

loadCharacterMethod · 0.95
drawOnRenderAreaMethod · 0.95
setRenderAreaMethod · 0.80
setCbcMethod · 0.80
setTransparencyMethod · 0.80

Tested by

no test coverage detected