diff options
author | Lizzy Hunt <lizzy.hunt@usu.edu> | 2024-01-12 19:13:13 -0700 |
---|---|---|
committer | Lizzy Hunt <lizzy.hunt@usu.edu> | 2024-01-12 19:13:13 -0700 |
commit | 07670ef8afb5a273267ea7149d5f7eef02fdf66b (patch) | |
tree | 2d0c8e64936c7fa2588786f4af199abf1bb48a60 /centipede/js/game/objects/bullet.js | |
parent | 3ac982dfa653f0eb7fbceeb1678a3cae93b512f4 (diff) | |
download | simponic.xyz-07670ef8afb5a273267ea7149d5f7eef02fdf66b.tar.gz simponic.xyz-07670ef8afb5a273267ea7149d5f7eef02fdf66b.zip |
add subprojects
Diffstat (limited to 'centipede/js/game/objects/bullet.js')
-rw-r--r-- | centipede/js/game/objects/bullet.js | 11 |
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 |