/
CMN_level6.js
50 lines (34 loc) · 892 Bytes
/
CMN_level6.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
/*
"Candy Mirror Ninja" est un jeu créé en mai 2014 par Aurélien Picolet.
"Candy Mirror Ninja" is a game created in May 2014 by Aurélien Picolet.
*/
CMN.Level6 = function(game) {
this.levelNumber = 6;
this.tilemapSource = "CMN_tilemap6.json";
this.game = game;
this.candyXY = [18*32, 6*32];
this.playerXY = [6*32, 6*32];
this.kingXY = [];
this.powerXY = [];
};
CMN.Level6.prototype = {
preload: function() {
level = new Level(game, this.tilemapSource, this.candyXY, this.kingXY, this.powerXY);
level.preload();
player = new Player(game, this.playerXY);
hud = new HUD(game, this.levelNumber);
},
create: function() {
level.create();
hud.create();
player.create();
},
update: function() {
level.update();
level.updateImages();
hud.update();
player.update();
player.updateImages();
level.checkEnd();
}
};