31 lines
595 B
JavaScript
31 lines
595 B
JavaScript
const asdf = require("asdf-games");
|
|
// eslint-disable-next-line no-unused-vars
|
|
const { Texture, Container, Sprite } = asdf;
|
|
|
|
var logo = new Texture("../res/images/asdf-logo.png");
|
|
|
|
class Logo extends Container {
|
|
constructor(game, onEnd) {
|
|
super();
|
|
this.game = game;
|
|
this.onEnd = onEnd;
|
|
|
|
this.children = [];
|
|
|
|
this.add(new Sprite(logo));
|
|
|
|
this.lifetime = 2;
|
|
}
|
|
|
|
update(dt, t) {
|
|
super.update(dt, t);
|
|
|
|
if (this.lifetime <= 0) {
|
|
this.onEnd();
|
|
} else {
|
|
this.lifetime -= dt;
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = Logo; |