--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 Skool
skool.com/game-development-skool-5007
Learn to make VIDEO GAMES! We make it simple to learn to make your first video game, get good at pixel art, and start your journey into GAME DEV!
Build your own community
Bring people together around your passion and get paid.
Powered by