simponic.xyz/centipede/js/game/objects/bullet.js
2024-01-12 19:13:13 -07:00

11 lines
250 B
JavaScript

game.Bullet = (spec) => {
const object = game.Object(spec);
const parentUpdate = object.update;
object.update = (elapsedTime) => {
parentUpdate(elapsedTime);
if (object.y < 0) {
object.alive = false;
}
};
return object;
}