simponic.xyz/centipede/js/game/objects/bullet.js

11 lines
250 B
JavaScript
Raw Normal View History

2024-01-12 21:13:13 -05:00
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;
}