-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathground.js
More file actions
36 lines (28 loc) · 1.04 KB
/
ground.js
File metadata and controls
36 lines (28 loc) · 1.04 KB
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
class Ground {
constructor(game, x, y, w, h) {
Object.assign(this, { game, x, y, w, h});
this.spritesheet = assetMangager.getAsset("./sprites/layer-5.png");
// this.animations = [];
// this.animations.push(new Animator(this.spritesheet, 0, 0, 48, 48, 1, 0.1, 0,0,false, true, false));
this.BB = new BoundingBox(this.x, this.y, this.w, this.h);
};
update() {
};
draw(ctx) {
// this.animations[0].drawFrame(this.game.clockTick, ctx, this.x , this.y, PARAMS.SCALE);
ctx.drawImage(this.spritesheet,this.x ,this.y, this.w, this.h);
ctx.strokeStyle = 'Red';
ctx.strokeRect(this.BB.x, this.BB.y, this.BB.width, this.BB.height);
};
};
// class BackGround {
// constructor(game, x, y, w, h) {
// Object.assign(this, { game, x, y, w, h});
// this.spritesheet = assetMangager.getAsset("./background.png");
// };
// update() {
// };
// draw(ctx) {
// ctx.drawImage(this.spritesheet,this.x ,this.y, this.w, this.h);
// };
// };