-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathbackground.js
104 lines (75 loc) · 2.83 KB
/
background.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
class BigHill {
constructor(game, x, y) {
Object.assign(this, { game, x, y });
this.spritesheet = ASSET_MANAGER.getAsset("./sprites/tiles.png");
};
update() {
};
drawMinimap(ctx, mmX, mmY) {
}
draw(ctx) {
ctx.drawImage(this.spritesheet, 86, 0, 80, 40, this.x - this.game.camera.x, this.y, PARAMS.BLOCKWIDTH * 5, PARAMS.BLOCKWIDTH * 2.5);
};
};
class Hill {
constructor(game, x, y) {
Object.assign(this, { game, x, y });
this.spritesheet = ASSET_MANAGER.getAsset("./sprites/tiles.png");
};
update() {
};
drawMinimap(ctx, mmX, mmY) {
}
draw(ctx) {
ctx.drawImage(this.spritesheet, 169, 20, 48, 20, this.x - this.game.camera.x, this.y, PARAMS.BLOCKWIDTH * 3, PARAMS.BLOCKWIDTH * 1.25);
};
};
class Bush {
constructor(game, x, y, size) {
Object.assign(this, { game, x, y, size });
this.spritesheet = ASSET_MANAGER.getAsset("./sprites/tiles.png");
};
update() {
};
drawMinimap(ctx, mmX, mmY) {
}
draw(ctx) {
ctx.drawImage(this.spritesheet, 288, 24, 8, 24, this.x - this.game.camera.x, this.y, PARAMS.BLOCKWIDTH * 0.5, PARAMS.BLOCKWIDTH * 1.5);
let i = 0;
for (; i < this.size; i++) {
ctx.drawImage(this.spritesheet, 296, 24, 16, 24, this.x - this.game.camera.x + PARAMS.BLOCKWIDTH * (i + 0.5), this.y, PARAMS.BLOCKWIDTH, PARAMS.BLOCKWIDTH * 1.5);
}
ctx.drawImage(this.spritesheet, 312, 24, 8, 24, this.x - this.game.camera.x + PARAMS.BLOCKWIDTH * (i + 0.5), this.y, PARAMS.BLOCKWIDTH * 0.5, PARAMS.BLOCKWIDTH * 1.5);
};
};
class Cloud {
constructor(game, x, y, size) {
Object.assign(this, { game, x, y, size });
this.spritesheet = ASSET_MANAGER.getAsset("./sprites/tiles.png");
};
update() {
};
drawMinimap(ctx, mmX, mmY) {
}
draw(ctx) {
ctx.drawImage(this.spritesheet, 211, 69, 8, 24, this.x - this.game.camera.x, this.y, PARAMS.BLOCKWIDTH * 0.5, PARAMS.BLOCKWIDTH * 1.5);
let i = 0;
for (; i < this.size; i++) {
ctx.drawImage(this.spritesheet, 219, 69, 16, 24, this.x - this.game.camera.x + PARAMS.BLOCKWIDTH * (i + 0.5), this.y, PARAMS.BLOCKWIDTH, PARAMS.BLOCKWIDTH * 1.5);
}
ctx.drawImage(this.spritesheet, 235, 69, 8, 24, this.x - this.game.camera.x + PARAMS.BLOCKWIDTH * (i + 0.5), this.y, PARAMS.BLOCKWIDTH * 0.5, PARAMS.BLOCKWIDTH * 1.5);
};
};
class BigCastle {
constructor(game, x, y) {
Object.assign(this, { game, x, y });
this.spritesheet = ASSET_MANAGER.getAsset("./sprites/castle_big.png");
};
update() {
};
drawMinimap(ctx, mmX, mmY) {
}
draw(ctx) {
ctx.drawImage(this.spritesheet, 0, 0, 145, 175, this.x - this.game.camera.x, this.y, PARAMS.BLOCKWIDTH * 9, PARAMS.BLOCKWIDTH * 11);
};
};