? Loading a map from the map editor ● SmileBASIC Source

Sign In

*Usernames are case-sensitive
Forgot my password
Currently in "Random page " mode! Reload to get another random page, or click the "Leave random" button below! Bookmarking this page will not work, and the page is read-only.

Loading a map from the map editor

Here's a short program function to load in files as saved by the map editor. OPTION STRICT ' Loads a multi-layer map from a file ' Based on LOADSUB from GAME3JUMP/JUMP KUN DEF LOAD_MAP FILENAME$ VAR BGW, BGH, TMAX, LN, TN, ADDR DIM RAW%[0] LOAD FILENAME$, RAW%, FALSE BGW = RAW%[4] * RAW%[6] BGH = RAW%[5] * RAW%[7] TMAX = BGW * BGH DIM LDATA%[TMAX] FOR LN = 0 TO RAW%[3] - 1 BGSCREEN LN, BGW ,BGH BGCLR LN FOR TN = 0 TO TMAX - 1 STEP 2 ADDR = TN DIV 2 + LN * TMAX / 2 + 264 LDATA%[TN] = RAW%[ADDR] AND &HFFFF LDATA%[TN + 1] = (RAW%[ADDR] >> 16) AND &HFFFF NEXT BGLOAD LN, LDATA NEXT END ACLS LOAD_MAP "DAT:MAP_YOURMAP"
1 vote
  • map
  • backgrounds
  • editor
  • load
0 Comment(s)