caa-game/src/entities/rock.js

28 lines
550 B
JavaScript

var asdf = require("asdf-games");
// eslint-disable-next-line no-unused-vars
const { Texture, TileSprite } = asdf;
const texture = new Texture(__dirname + "/../../res/images/tilemap.png");
class Rock extends TileSprite {
constructor(pos, type) {
super(texture, 32, 32);
this.pos = pos;
this.scale = { x: 1, y: 1 };
this.frame = type === "Big" ? { x: 0, y: 7 } : { x: 4, y: 6};
this.hitBox = {
x: 1,
y: 1,
w: 28,
h: 28
};
}
update(dt) {
super.update(dt);
}
}
module.exports = Rock;