SpaceCat's Game Dev Heroes!
Log In
Community
Classroom
Members
Leaderboards
About
Log In
2
YoussefΒ Badawy
Sep 12 β’
Feedback Plz?
--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
Like
5
6 comments
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!
258
Members
1
Online
1
Admin
JOIN GROUP
Suggested communities
Calligraphy Skool
The Acting Lab
Di-Maccio Art Academy
Printable Sticker Weekend
Bourbonado Community
Build your own community
Bring people together around your passion and get paid.
Get started
Powered by