-
Notifications
You must be signed in to change notification settings - Fork 0
/
Preloader.js
74 lines (58 loc) · 4.82 KB
/
Preloader.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
var tilemap = { "height":10,
"infinite":false,
"layers":[
{
"data":[98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 98, 0, 0, 0, 0, 98, 98, 98, 98, 0, 98, 98, 98, 0, 0, 98, 98, 0, 0, 0, 0, 98, 0, 0, 0, 0, 0, 0, 98, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 98, 0, 0, 0, 0, 0, 0, 0, 98, 98, 98, 0, 0, 98, 98, 0, 0, 98, 98, 0, 0, 0, 0, 4, 0, 0, 98, 0, 0, 0, 98, 98, 98, 98, 98, 0, 0, 98, 98, 98, 0, 0, 0, 0, 0, 0, 98, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 98, 98, 0, 0, 0, 0, 98, 98, 98, 98, 0, 98, 98, 98, 0, 0, 98, 98, 98, 0, 0, 98, 98, 0, 0, 0, 0, 98, 0, 98, 98, 98, 98, 0, 0, 0, 98, 98, 0, 0, 98, 98, 0, 0, 0, 98, 98, 0, 0, 98, 98, 98, 0, 0, 98, 98, 0, 0, 98, 98, 0, 0, 0, 0, 0, 0, 98, 98, 0, 0, 0, 98, 98, 98, 98, 98, 0, 0, 98, 98, 98, 0, 0, 0, 0, 0, 0, 98, 98, 0, 0, 0, 0, 5, 0, 0, 98, 98, 98, 98, 98, 98, 98, 98, 0, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 0, 98, 98, 98, 98, 98, 98, 0, 98, 98, 98, 98, 98, 98, 98, 0, 98, 98, 98, 0, 0, 98, 98, 98, 0, 0, 98, 98, 98, 0, 98, 98, 98, 0, 98, 98, 98, 0, 0, 98, 98, 98, 0, 98, 98, 0, 0, 98, 98, 98, 0, 0, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 0, 5, 0, 0, 0, 6, 98, 98, 82, 82, 82, 82, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 18, 18, 18, 98, 98],
"height":10,
"name":"Kachelebene 1",
"opacity":1,
"type":"tilelayer",
"visible":true,
"width":100,
"x":0,
"y":0
}],
"nextobjectid":1,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.1.1",
"tileheight":32,
"tilesets":[
{
"columns":16,
"firstgid":1,
"image":"goodly-2x.png",
"imageheight":512,
"imagewidth":512,
"margin":0,
"name":"default",
"spacing":0,
"tilecount":256,
"tileheight":32,
"tilewidth":32
}],
"tilewidth":32,
"type":"map",
"version":1,
"width":100
};
Game.Preloader = function(game) {
this.preloadBar = null;
};
Game.Preloader.prototype = {
preload:function() {
this.preloadBar = this.add.sprite(this.world.centerX,this.world.centerY,'preloaderBar');
this.preloadBar.anchor.setTo(0.5);
this.time.advancedTiming = true;
this.load.setPreloadSprite(this.preloadBar);
//LOAD ALL ASSESTS
this.load.tilemap('map',null, tilemap, Phaser.Tilemap.TILED_JSON);
this.load.image('tileset','assets/goodly-2x.png');
this.load.spritesheet('player','assets/dude.png',32,48);
this.load.image('bar','assets/powerBar.png');
this.load.image('filling','assets/powerBarFilling.png');
},
create:function() {
this.state.start('Level');
},
}