Play demo
drops_1k's itch.io pageCompressed Bytes used
624
Source Code (OPTIONAL)
-- drops
-- a short demo by @iliazeus
function _init()
?"\a00sgl20i1v3x5a2."
?"\a01sgl20i1v3x5c3."
?"\a02sgl20i1v3x5d3."
?"\a03sgl20i1v3x5e3."
?"\a04sgl20i1v3x5g3."
?"\a05sgl20i1v3x5a1."
?"\a06sgl20i1v3x5c2."
?"\a07sgl20i1v3x5d2."
?"\a08sgl20i1v3x5e2."
?"\a09sgl20i1v3x5g2."
sfx(-1)
ps = {}
qs = {}
qn = 2
dq = 120
end
function _draw()
cls(12)
if dq > 0 then
print("\^w\^tdrops",20,20,0)
end
for i = 1, #ps do
pset(ps[i].x, ps[i].y, 1)
end
end
function _update()
if btnp(โฌ
๏ธ) and qn > 0 then
qn -= 1
elseif btnp(โก๏ธ) and qn<4 then
qn += 1
end
if dq > 0 then
dq -= 1
end
for i = 0, qn-1 do
if qs[i] then
qs[i] -= 1
if qs[i] <= 0 then
qs[i] = nil
local n = flr(rnd(5))
if (i==2) n += 5
sfx(n, i)
local v = 0.1 + rnd(0.5)
local x0 = rnd(128)
local y0 = rnd(128)
for phi = 1/32, 1, 1/32 do
add(ps, {
x = x0 + 1 * cos(phi),
y = y0 + 1 * sin(phi),
dx = v * cos(phi),
dy = v * sin(phi) / 2,
t = rnd(30),
})
end
end
end
if not qs[i]
and stat(46 + i) == -1
then
qs[i] = max(dq/2,10)+rnd(15)
end
end
for i = #ps, 1, -1 do
local p = ps[i]
p.t -= 1
p.x += p.dx; p.y += p.dy
if p.t <= 0 then
ps[i] = ps[#ps]; deli(ps)
end
end
end
Leave a comment
Log in with itch.io to leave a comment.
Comments
i love it
This is really nice.
The ripple visual effect is just.... ๐๐
Paired with the harmonic sounds, this is a very relaxing entry. ๐