Okay, let's do it the EASY way then....
TRY This code instead;
Remstart
Aurthor: Beehive Studios
Date Started: 08/07/2004
Date Last modified: 08/07/2004
Product Name: 3D Pacman
Product Version: v0.1
Remend
Rem Initialization
Set Display Mode 800,600,32
Hide Mouse : Sync On : Sync Rate 40
Backdrop On : Color Backdrop RGB(0,0,0) : CLS
Rem Setup map vairables
Mapsize=23
Dim Map$(Mapsize,Mapsize)
Rem load textures
Load image "Floor.jpg",1,1
Load image "Wall.jpg",2,1
objectnumber = 1
LoadMap("Level1.txt",Mapsize)
For z=1 to Mapsize
For x=1 to Mapsize
If Map$(x,z)="#"
Make Object Cube ObjectNumber,16
objectnumber = objectnumber + 1
Position Object ObjectNumber,x*32,0,z*32
Texture Object ObjectNumber,1
endif
next x
next z
For z=1 to Mapsize
For x=1 to Mapsize
If Map$(x,z)="."
Make Object Plain ObjectNumber,32,32
objectnumber = objectnumber + 1
Position Object ObjectNumber,x*32,0,z*32
Texture Object ObjectNumber,2
endif
next x
Next z
If EscapeKey()=1 then end
Wait Key
Function LoadMap(Filename$,Size)
Open to read 1,Filename$
For x=1 to Size
For y=1 to Size
Read Byte 1,tmp
map$(x,y)=chr$(tmp)
next y
next x
Close File 1
Endfunction
S.
Any truly great code should be indisguishable from magic.