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

Method addGround

code/main/Desert.ts:166–175  ·  view source on GitHub ↗
(...positions: number[])

Source from the content-addressed store, hash-verified

164 }
165
166 private addGround(...positions: number[]): void{
167 // Create the wall entity
168 this.addEntity(new Wall(this, new Pos(0, 26)));
169 var wall: Wall = <Wall>(this.getLastEntity());
170
171 // Add the boxes
172 for(var i = 0; i < positions.length/3; i++){
173 wall.addBox(new Pos(positions[i*3], positions[i*3+2]), new Pos(positions[i*3+1] - positions[i*3] + 1, 4-positions[i*3+2]));
174 }
175 }
176
177 private setNextBirdAt(): void{
178 this.nextBirdAt = 20 + Random.upTo(30);

Callers 1

constructorMethod · 0.95

Calls 3

addEntityMethod · 0.80
getLastEntityMethod · 0.80
addBoxMethod · 0.80

Tested by

no test coverage detected