i am having a problem with my code.
`--------------------------------
`set window
`--------------------------------
X = 1280
Y = 1024
sync on : sync rate 0
set display mode X,Y,16
remstart
set window on : set window size X,Y
lock backbuffer
bbX = get backbuffer width()
bbY = get backbuffer height()
set window position (bbX/2),(bbY/2)
unlock backbuffer
set window title "2D Map Editor"
remend
`backdrop on
`--------------------------------
`--------------------------------
`sync on : sync rate 0
load_images:
`load grass images
for b = 0 to 8
load image "media\grass\" +str$(b) +".bmp", b+1
next b
`load dirt images
for b = 9 to 17
load image "media\dirt\" +str$(b) +".bmp", b+1
next b
load image "media\buttons\up.bmp", 100 : `up button
load image "media\buttons\upp.bmp", 101 : `up button pressed
load image "media\buttons\down.bmp", 102 : `down button
load image "media\buttons\downp.bmp", 103 : `down button pressed
load image "media\buttons\right.bmp", 104 : `right button
load image "media\buttons\rightp.bmp", 105 : `right button pressed
load image "media\buttons\left.bmp", 106 : `left button
load image "media\buttons\leftp.bmp", 107 : `left button pressed
load image "media\buttons\plus.bmp", 108 : `plus button
load image "media\buttons\plusp.bmp", 109 : `plus button pressed
load image "media\buttons\minus.bmp", 110 : `minus button
load image "media\buttons\minusp.bmp", 111 : `minus button pressed
return
make_tiles:
return
`Choose Map size and all that stuff
start:
Print "How many tiles horizontally?"
input xsize#
Print "How many tiles vertically?"
input ysize#
Print "What do you want to start with?"
Print "1)Grass"
Print "2)Dirt"
Print "3)Snow"
Print "4)Shallow Water"
Print "5)Deep Water"
input start_tileset#
remstart
0-8 are grass
0 is center
1 2 3 4 are grass topleft topright bottomleft bottom right corners
5 6 7 8 are top bottom left right grass
9-17 are dirt
9 is center
10 11 12 13 are corners
14 15 16 17 are top... dirt
18-25 are snow
18 is center
19 20 21 22 are corners
23 24 25 26 are top... snow
27-35 are Shallow water
27 is center
28 29 30 31 are corners
32 33 34 35 are top... swater
36-44 are deep water
36 is center
37 38 39 40 are corners
41 42 43 44 are top... dwater
remend
if start_tileset# = 1 then start_tileset = 0
if start_tileset# = 2 then start_tileset = 9
if start_tileset# = 3 then start_tileset = 18
if start_tileset# = 4 then start_tileset = 27
if start_tileset# = 5 then start_tileset = 36
dim map(xsize#,ysize#)
`intilize matrix to = the choice above
for x = 1 to xsize#
for y = 1 to ysize#
map(x,y) = start_tileset
next y
next x
cls
matxsize = xsize# * 16 : `for tiles that are 30 units in size.
matzsize = ysize# * 16 : `for tiles that are 30 units in size.
Make Matrix 1,matxsize,matzsize,xsize#,ysize#
`---------------------------------------------------------
`texture the matrix
Prepare Matrix Texture 1,start_tileset + 1,1,1
`I used 3x3 because you have 5 textures to choose from,
`so that divides the image into the sections it needs.
For x = 0 To xsize#-1
For y = 0 To ysize#-1
Set Matrix Tile 1,x,y,map(x,y)
Next y
Next x
Update Matrix 1
`----------------------------------------------------------
sync
camx# = 300
camy# = 800
camz# = 300
Position Camera camx#,camy#,camz#
`Main loop
main:
do
mx = mousex()
my = mousey()
gosub control
Position Camera camx#,camy#,camz#
Point Camera Camera Position X(),0,Camera Position Z()
sync
loop
return
`---------------------------------------
`control
`---------------------------------------
control:
If UpKey() = 1 Then camz# = camz# + 1
If DownKey() = 1 Then camz# = camz# - 1
If RightKey() = 1 Then camx# = camx# + 1
If LeftKey() = 1 Then camx# = camx# - 1
If keystate(201) then inc camy#
If keystate(209) then dec camy#
return
it wont let me start with 2 (dirt) i dont understand why not. it works perfectly with 1. so i dont know whats up. any help? it says "matrix tiles doesnt exist" or something lik ethat