forked from phaserjs/custom-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phaser-custom.js
48 lines (40 loc) · 1.73 KB
/
phaser-custom.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
38
39
40
41
42
43
44
45
46
47
48
require('phaser/src/polyfills');
// We use "var" instead of "const" and "let" since this file will actually be included in client code.
var CONST = require('phaser/src/const');
var Extend = require('phaser/src/utils/object/Extend');
var Phaser = {
Cameras: {
Scene2D: require('phaser/src/cameras/2d')
},
Events: require('phaser/src/events/EventEmitter'),
Game: require('phaser/src/core/Game'),
GameObjects: {
// Add the these two to make the indexsprite.html test work!
Image: require('phaser/src/gameobjects/image/Image'),
Sprite: require('phaser/src/gameobjects/sprite/Sprite'),
DisplayList: require('phaser/src/gameobjects/DisplayList'),
UpdateList: require('phaser/src/gameobjects/UpdateList'),
Graphics: require('phaser/src/gameobjects/graphics/Graphics.js'),
Factories: {
// Add the these two to make the indexsprite.html test work!
Image: require('phaser/src/gameobjects/image/ImageFactory'),
Sprite: require('phaser/src/gameobjects/sprite/SpriteFactory'),
Graphics: require('phaser/src/gameobjects/graphics/GraphicsFactory')
},
Creators: {
// Add the these two to make the indexsprite.html test work!
Image: require('phaser/src/gameobjects/image/ImageCreator'),
Sprite: require('phaser/src/gameobjects/sprite/SpriteCreator'),
Graphics: require('phaser/src/gameobjects/graphics/GraphicsCreator')
}
},
Loader: require('phaser/src/loader'),
Math: {
Between: require('phaser/src/math/Between')
}
}
// Merge in the consts
Phaser = Extend(false, Phaser, CONST);
// Export it
module.exports = Phaser;
global.Phaser = Phaser;