loadMap()
Purpose
Load a tile map file
Description
Load a tile map file created in the tile map editor into memory
Syntax
loadMap( filename )
Arguments
filename The name of the map created with the tile map editor
Example
// To view this map demo, please load the project "Map Commands Demo" from FUZE Programs.
// Maps must be stored in the project you wish to load them into.
maps = [
"map1",
"map2"
]
m = 0
layer = false
press = [
.a = false,
.up = false
]
loadMap( maps[m] )
setSpriteCamera( 0, 0, 2 )
loop
centerSpriteCamera( 0, 0 )
clear()
c = controls( 0 )
if !c.a then
press.a = false
endIf
if !c.up then
press.up = false
endIf
drawMapLayer( 0 )
if layer then
drawMapLayer( 1 )
endIf
if c.up and !press.up then
press.up = true
layer = !layer
endIf
if c.a and !press.a then
press.a = true
unloadMap()
m += 1
if m >= 2 then
m = 0
endIf
loadMap( maps[m] )
endIf
printAt( 0, 0, "Press A button to swap between maps" )
printAt( 0, 2, "Currently viewing: " + maps[m] )
printAt( 0, 4, "Press Up directional button to toggle additional layers" )
update()
repeat
Associated Commands
collideMap(), drawMap(), drawMapLayer(), getMapArea(), getMapAreaNames(), getMapLocation(), getMapLocationNames(), unloadMap(), updateMap()