TutorialsUsing assets

Tutorial: Using Assets

Assets make games feel specific. Moosh supports PNG/JPG images and MP3 audio uploaded per game.

Upload files

Use the editor asset panel and choose clear filenames such as player.png, coin.mp3, or sparkle.json. Avoid spaces so examples and generated code stay simple.

Load and draw an image

from conjure import *
 
init_window(360, 640, "Assets")
player = load_image("player.png")
 
while not window_should_close():
    begin_drawing()
    clear_background(WHITE)
    draw_image(player, 120, 260)
    end_drawing()

Add sound

Load sounds once and call play_sound from input or collision events. Browser audio starts after the player presses Play.

What next

See images and audio for function-level details.