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

Method addEntity

code/main/Quest.ts:98–110  ·  view source on GitHub ↗
(entity: QuestEntity)

Source from the content-addressed store, hash-verified

96 }
97
98 public addEntity(entity: QuestEntity): boolean{
99 // Add the entity
100 this.entities.push(entity);
101
102 // If it collides, remove it and return false (+ BUGS)
103 if(this.entities[this.entities.length-1].checkCollision() && Bugs.getQuestBugLevel() < 4){
104 this.entities.splice(this.entities.length-1, 1);
105 return false;
106 }
107
108 // Else, successfully added, we return true
109 return true;
110 }
111
112 public addExitQuestButton(callbackCollection: CallbackCollection, buttonText: string): void{
113 this.addBackToButton(this.renderArea,

Callers 15

castPlayerAcidRainMethod · 0.95
castPlayerBlackDemonsMethod · 0.95
castPlayerBlackholeMethod · 0.95
castPlayerFireballMethod · 0.95
constructorMethod · 0.80
addATreeMethod · 0.80
addGroundMethod · 0.80
constructorMethod · 0.80
addGroundMethod · 0.80

Calls 1

checkCollisionMethod · 0.45

Tested by

no test coverage detected