I use strings for levels, then i use string functions to check what characters is in the string, and place the sprites accordingly.
Part of the function to make levels:
function FUN_initialize_level(level)
select level
case 1:
hero_direction=1
levelbonus=0
level$[1] =" 3 "
level$[2] =" 2h 3 "
level$[3] =" 22 "
level$[4] =" x 3 "
level$[5] =" "
level$[6] =" 3 y 3 "
level$[7] =" 2 11111"
level$[8] =" 2 z g1"
level$[9] =" 11111"
arrows$[1] = "d "
arrows$[2] = "r "
endcase
blablabla...
// Draw level data. Called as initializing AND redraw code!
levelscore=0
levelmaxscore=0
nextghost=1
s=1
for y=1 to 9
for x=1 to 16
a=img_null
// Find next item in level string
l$=mid(level$[y],x,1)
// Place the hero sprite
if l$="h"
a=img_null
heroXgrid=x-1
heroYgrid=y-1
FUN_rotate_hero()
FUN_set_sprite_on_grid()
object1.sprite=1+(heroXgrid+(16*heroYgrid))
endif
// Place the ghost sprite
if l$="s"
a=img_null
ghosts[nextghost].Xgrid=x-1
ghosts[nextghost].Ygrid=y-1
setspriteposition(ghosts[nextghost].sprite,(ghosts[nextghost].Xgrid*64)+32,(ghosts[nextghost].Ygrid*64)+32)
inc nextghost,1
endif
// Draw background and obstacles
if l$=" " then a=img_null
if l$="1" then a=img_wall_1
if l$="2" then a=img_wall_2
if l$="3" then a=img_wall_3
if l$="4" then a=img_wall_4
if l$="5" then a=img_wall_5
if l$="6" then a=img_wall_6
if l$="7" then a=img_wall_7
if l$="8" then a=img_wall_8
if l$="9" then a=img_wall_9
// Draw speccial objects
if l$="b" then a=img_bomb_1
if l$="g" then a=img_goal
if l$="k"
a=img_key_1
inc levelmaxscore,15
endif
if l$="d"
a=img_door_1
inc levelmaxscore,10
endif
// Draw bonus objects
if l$="x"
a=img_bonus_1
inc levelmaxscore,20
endif
if l$="y"
a=img_bonus_2
inc levelmaxscore,20
endif
if l$="z"
a=img_bonus_3
inc levelmaxscore,20
endif
blablabla...
----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.