-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.js
37 lines (36 loc) · 1.16 KB
/
game.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
define([
'phaser',
'const'
], function (Phaser, Const) {
'use strict';
return function(){
var root = this;
this.start = function() {
root.game = new Phaser.Game(
// Const.overallWidth,
// Const.overallHeight,
Const.avail.width(),
Const.avail.height(),
Phaser.AUTO,
'',
{
preload: root.preload,
create: root.create,
update: root.update
});
};
this.create = function(){
root.game.stage.backgroundColor = Const.bgColor ;
// var logo = this.game.add.sprite(root.game.world.centerX, root.game.world.centerY, 'logo');
root.game.scale.fullScreenScaleMode = Phaser.ScaleManager.EXACT_FIT;
root.game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
root.game.scale.pageAlignHorizontally = true;
root.game.scale.pageAlignVertically = true;
};
this.preload = function(){
root.game.load.script('webfont', '//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js');// Load the Google WebFont Loader script
};
this.update = function(){
};
};
});