summaryrefslogtreecommitdiff
path: root/centipede/js/game/objects/bullet.js
diff options
context:
space:
mode:
Diffstat (limited to 'centipede/js/game/objects/bullet.js')
-rw-r--r--centipede/js/game/objects/bullet.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/centipede/js/game/objects/bullet.js b/centipede/js/game/objects/bullet.js
new file mode 100644
index 0000000..5791aca
--- /dev/null
+++ b/centipede/js/game/objects/bullet.js
@@ -0,0 +1,11 @@
+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;
+} \ No newline at end of file