From 23383a22b2b1e0508053f9559f4174d7e163b103 Mon Sep 17 00:00:00 2001 From: 1029chris <1029chris@gmail.com> Date: Wed, 2 Feb 2022 17:13:53 -0800 Subject: Added circle particles, and more bullet stuff --- particles.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 particles.lua (limited to 'particles.lua') diff --git a/particles.lua b/particles.lua new file mode 100644 index 0000000..29a8140 --- /dev/null +++ b/particles.lua @@ -0,0 +1,26 @@ +function addcircle(x, y, velx, vely, r, time, color) + local circle = {} + circle.x = x + circle.y = y + circle.velx = velx + circle.vely = vely + circle.r = r + circle.time = time + circle.t = time + circle.col = color + + function circle.draw(circle) + circfill(circle.x, circle.y, circle.r*sin(circle.time/circle.t), circle.col) + end + + function circle.update(circle) + circle.x += circle.velx + circle.y += circle.vely + circle.time -= 1/60 + if circle.time < 0 then + del(obj, circle) + end + end + + add(obj, circle) +end \ No newline at end of file -- cgit