nonZero, sorry for being a little off topic, but how do you get syntax highlighting to work in the code snippets? ^^
So this post isn't completely off topic, I'll throw some code that's slightly related to the OP in your face
//takes a map from map.txt and makes it into a 3d scene. move player with wasd
sync on : sync rate 60
dim row$(100) : dim map$(100,100)
color backdrop rgb(10,10,10)
player_pos_x = 0 : player_pos_y = 0
map_size_x = 0 : map_size_y = 0
floor_color = rgb(100,100,100)
dot 0,0,floor_color
get image 1,0,0,1,1
r = 0
open to read 1,"map.txt"
repeat
inc r
read string 1,row$(r)
until row$(r) = ""
close file 1
map_size_x = len(row$(1))
map_size_y = r - 1
for x = 1 to map_size_x
for y = 1 to map_size_y
map$(x,y) = mid$(row$(y),x)
next y
next x
obj_no = 2
for x = 1 to map_size_x
for y = 1 to map_size_y
if map$(x,y) = "*"
make object cube obj_no,10
position object obj_no,x*10,0,y*10
inc obj_no
endif
if map$(x,y) = "P"
player_pos_x = x
player_pos_y = y
endif
next y
next x
make matrix 1,map_size_x*10,map_size_y*10,map_size_x,map_size_y
position matrix 1,5,0,5
prepare matrix texture 1,1,1,1
set matrix wireframe off 1
make object cube 1,5
position object 1,player_pos_x*10,0,player_pos_y*10
position camera 105,190,105
point camera 105,0,105
do
if keystate(17) = 1 and u = 0 and map$(player_pos_x,player_pos_y+1) = "#"then inc player_pos_y : u = 1
if keystate(17) = 0 then u = 0
if keystate(31) = 1 and d = 0 and map$(player_pos_x,player_pos_y-1) = "#"then dec player_pos_y : d = 1
if keystate(31) = 0 then d = 0
if keystate(30) = 1 and l = 0 and map$(player_pos_x-1,player_pos_y) = "#"then dec player_pos_x : l = 1
if keystate(30) = 0 then l = 0
if keystate(32) = 1 and r = 0 and map$(player_pos_x+1,player_pos_y) = "#" then inc player_pos_x : r = 1
if keystate(32) = 0 then r = 0
position object 1,player_pos_x*10,0,player_pos_y*10
set camera to follow object position x(1),0,object position z(1),0,0,150,50,0
rotate camera 90,0,0
sync
loop
map.txt:
*********##*********##******
*********##*********##*####*
*********##*********##*####*
*********##*********#######*
*********##*********##*####*
*********##*********##******
*********##*********##*####*
*********##*********##*####*
*********##*********##*####*
###########################*
P##########################*
*********##*********##*####*
***##############***##*####*
***#####*##*#####***##*####*
***##############***##******
*********##*********##******
***##############***##******
***#####*##*#####***##******
***##############***##******
*********##*********##******
edit: changed the code a little + put syntax highlighting on