Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion assets/asteroids.ms
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,12 @@ render = function
raylib.DrawFPS
end function

unload = function
raylib.UnloadTexture spriteSheetTex
raylib.UnloadFont scoreFont
sounds.unload
end function

run = function
init
while true
Expand All @@ -417,7 +423,8 @@ run = function
raylib.EndDrawing
if raylib.IsKeyPressed(raylib.KEY_ESCAPE) or raylib.IsKeyPressed(raylib.KEY_Q) then break
yield
end while
end while
unload
end function

if locals == globals then run
7 changes: 7 additions & 0 deletions assets/sounds.ms
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ boom = makeSound(samples)

sounds = [null, wooble, boop, pew, white, hit, boom]

unload = function
for sound in sounds
if sound!=null then raylib.UnloadSound sound
end for
end function

run = function
x = 100; y = 100
dx = 10; dy = 10
Expand All @@ -112,6 +118,7 @@ run = function
raylib.EndDrawing
yield
end while
unload
end function

if locals == globals then run