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

Method drawGame

code/main/GalacticWars.ts:226–245  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

224 }
225
226 private drawGame(): void{
227 // Draw the score
228 this.getRenderArea().drawString("Score : " + this.score.toString(), 0, 0);
229
230 // Draw hp
231 this.getRenderArea().drawString("| HP : " + this.hp.toString(), 43, 0);
232
233 // Draw the power
234 this.getRenderArea().drawString("| Power : [", 14, 0);
235 this.getRenderArea().drawHorizontalLine("x", 25, 25 + Math.floor(this.power / 150 * 16), 0);
236 this.getRenderArea().drawString("]", 41, 0);
237
238 // Draw the ship
239 this.getRenderArea().drawArray(Database.getAscii("places/village/thirdHouseGames/GalacticWars/ship"), 0, 1 + this.shipYPosition);
240
241 // Draw asteroids
242 for(var i = 0; i < this.asteroids.length; i++){
243 this.getRenderArea().drawString("O", this.asteroids[i].x, 1 + this.asteroids[i].y);
244 }
245 }
246
247 private drawLose(): void{
248 // Draw "you lose"

Callers 1

runMethod · 0.95

Calls 5

drawStringMethod · 0.80
drawHorizontalLineMethod · 0.80
drawArrayMethod · 0.80
getAsciiMethod · 0.80
getRenderAreaMethod · 0.45

Tested by

no test coverage detected