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

Method run

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

Source from the content-addressed store, hash-verified

30
31 // Public methods
32 public run(): boolean{
33 // To store the return value
34 var returnValue: boolean = false;
35
36 // If we should exit the game, we return true
37 if(this.exitGame)
38 return true;
39
40 // Reset the area
41 this.getRenderArea().resetAllButSize();
42
43 // Do something different depending on the step
44 switch(this.step){
45 case GalacticWarsStep.SPLASH_SCREEN:
46 this.drawSplashScreen();
47 returnValue = this.runSplashScreen();
48 break;
49 case GalacticWarsStep.GAME:
50 this.drawGame();
51 returnValue = this.runGame();
52 break;
53 case GalacticWarsStep.LOSE:
54 this.drawLose();
55 returnValue = false;
56 break;
57 }
58
59 // We return
60 return returnValue;
61 }
62
63 // Private methods
64 private addAsteroids(): void{

Callers

nothing calls this directly

Calls 7

drawSplashScreenMethod · 0.95
runSplashScreenMethod · 0.95
drawGameMethod · 0.95
runGameMethod · 0.95
drawLoseMethod · 0.95
resetAllButSizeMethod · 0.80
getRenderAreaMethod · 0.45

Tested by

no test coverage detected