How to use the phaserGame function from global

Find comprehensive JavaScript global.phaserGame code examples handpicked from public code repositorys.

7
8
9
10
11
12
13
14
15
16

var settings = global.settings;

function preload() {
  global.phaserGame.stage.scaleMode = Phaser.StageScaleMode.SHOW_ALL;
  global.phaserGame.stage.scale.setScreenSize(true);

  sounds.preload();
  scene.preload();
}
fork icon8
star icon34
watch icon4

+ 21 other calls in file

12
13
14
15
16
17
18
19
20
21
var gameStarted = false, crashed = false, crashedGround = false;
var scoreText, score;
var timeElapsedText, timeElapsed, startTime;

function createBackground() {
  var graphics = global.phaserGame.add.graphics(0, 0);
  graphics.beginFill(0xDDEEFF, 1);
  graphics.drawRect(0, 0, global.phaserGame.width, global.phaserGame.height);
  graphics.endFill();
}
fork icon0
star icon1
watch icon4

+ 219 other calls in file