diff options
| author | 1029chris <1029chris@gmail.com> | 2022-02-15 00:09:01 -0800 |
|---|---|---|
| committer | 1029chris <1029chris@gmail.com> | 2022-02-15 00:09:01 -0800 |
| commit | a6593607c200c094c872b0d79320a077772619c6 (patch) | |
| tree | 6e17c194e081bea13f2dae6562763fc87e49c596 /bullets.lua | |
| parent | ec827f9b4059b457adac81855483a26cc19e621f (diff) | |
new enemies!!! more optimizations!!!
Diffstat (limited to 'bullets.lua')
| -rw-r--r-- | bullets.lua | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/bullets.lua b/bullets.lua index c7a47b0..c287da1 100644 --- a/bullets.lua +++ b/bullets.lua @@ -1,12 +1,12 @@ function addbullet(x, y, velx, vely, evil, sprite) - local bullet = {} - - bullet.sprite = sprite - bullet.evil = evil - bullet.x = x - bullet.y = y - bullet.velx = velx - bullet.vely = vely + local bullet = { + sprite = sprite or 2, + evil = evil, + x = x, + y = y, + velx = velx, + vely = vely, + } function bullet.draw(bullet) spr(bullet.sprite, bullet.x, bullet.y) @@ -48,14 +48,14 @@ function addbullet(x, y, velx, vely, evil, sprite) end function addlaser(x, y, r) - local laser = {} - - --lasers!!!!!!!!!!!!!!! - laser.x = x - laser.y = y - laser.r = r - laser.timer = 0 - laser.playingsound = false + local laser = { + --lasers!!!!!!!!!!!!!!! + x = x, + y = y, + r = r, + timer = 0, + playingsound = false + } function laser.draw(laser) if laser.timer > 1.5 then |
