--Clouds system--
--I mad e a small project. its a clouds spawn system.--
-Is it good?πŸ€” -Need your feedback.
--here is the code--
clouds={}
function make_clouds()
c={}
c.x=rnd(160)
c.y=rnd(60)
c.spd=rnd(0.5)+0.2
add(clouds,c)
end
function update_clouds()
for c in all(clouds) do
c.x+=c.spd
if c.x>128 then
c.x=-16
c.y=rnd(60)
end
end
end
function draw_clouds()
for c in all(clouds) do
spr(1,c.x,c.y,2,2)
end
end
function _init()
for i=1,15 do
make_clouds()
end
end
function _update()
update_clouds()
end
function _draw()
cls(12)
draw_clouds()
end
5
6 comments
Youssef Badawy
2
--Clouds system--
powered by
SpaceCat's Game Dev Heroes!
skool.com/game-development-skool-5007
Learn pixel art and game development with the wonderful Pico-8 Game Engine! Discussion, courses, and resources to learn to make your own games!
Build your own community
Bring people together around your passion and get paid.
Powered by