11 lines
250 B
JavaScript
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;
|
|
} |