aboutsummaryrefslogtreecommitdiff
path: root/background.lua
diff options
context:
space:
mode:
authorRibbon <ambiguousmachine@gmail.com>2022-02-02 17:45:40 -0800
committerRibbon <ambiguousmachine@gmail.com>2022-02-02 17:45:40 -0800
commit377c0bdb35fd9eddc0e144f2c540f2cc8f733036 (patch)
treee98bee221a27908c5d79459ac1fe7ca3d6256f66 /background.lua
parent23383a22b2b1e0508053f9559f4174d7e163b103 (diff)
CIRCLES
Diffstat (limited to 'background.lua')
-rw-r--r--background.lua46
1 files changed, 41 insertions, 5 deletions
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
+