From 377c0bdb35fd9eddc0e144f2c540f2cc8f733036 Mon Sep 17 00:00:00 2001 From: Ribbon Date: Wed, 2 Feb 2022 17:45:40 -0800 Subject: CIRCLES --- background.lua | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) (limited to 'background.lua') diff --git a/background.lua b/background.lua index dab354d..fd5073c 100644 --- a/background.lua +++ b/background.lua @@ -1,7 +1,43 @@ -cls(1) +bgcircles = {} +circletimer = 0 -rectfill(0,0,128,16,13) -rectfill(0,64,128,128,13) -rectfill(0,80,128,128,2) --- rectfill(0,100,128,128,2) \ No newline at end of file +function addbgcircle(x, y, velx, r, color, pos) + local circle = {} + circle.x = x + circle.y = y + circle.velx = velx + circle.r = r + circle.color = color + + function circle.draw(circle) + circle.x += circle.velx + + if circle.x < 0 - circle.r * 2 then + del(bgcircles, circle) + end + circfill(circle.x,circle.y,circle.r,circle.color) + end + add(bgcircles,circle, pos) +end + + + + + +function drawbg() + cls(1) + + circletimer -= 1/60 + if circletimer < 0 then + circletimer = .8 + addbgcircle(180,100,-1,32,3) + end + + foreach(bgcircles, function(circle) circle:draw() end) + + -- rectfill(0,0,128,16,13) + -- rectfill(0,64,128,128,13) + -- rectfill(0,80,128,128,2) +end + -- cgit