How to make my map show
-
I don't know if I'm stupid or my game is broken but when I try to show my map on screen with the loadmap() it doesn't work. I don't know what I need to do please help me
-
Not stupid, drawmap() in your main loop.
Any further problems don't hesitate to ask for help! -
@soggy-games Hey there - don't worry, it sounds like you're just missing the
drawMap()
function. Nothing broken and you're certainly not stupid!loadMap()
just loads a map into memory. You have to usedrawMap()
to make it appear. Your program might look something like this:loadMap("map_name") cam_pos = {0, 0, 1} // Camera is pointing directly at the centre of the map - (0, 0) with a zoom of 1 loop clear() setSpriteCamera(cam_pos) // All game logic should go here // At the end of the loop, draw things drawMap() // Make sure to draw the map before you draw any sprites, or the sprites won't appear! drawSprites() update() repeat
Best of luck. Let me know if you need help with anything else!
EDIT: Added setSpriteCamera() to the program as @Kat raises a good point.
-
@waldron Haha, you beat me to it!
-
You may also want to check the position of the sprite camera. By default the camera will be pointing at {0, 0} which is where the blue lines intersect in the map editor, so make sure your map is centred around that point or reposition your sprite camera in the program with setSpriteCamera(). If you haven't already, definitely check out the help page for the Sprite System in the Command Reference which will be really helpful when you're working with maps and sprites :)
-
@dave thanks!