I have this example:
SET DISPLAY MODE 512,384,16
rem DISABLE ESCAPEKEY
DIM Map(15,12)
REM Esta é a ordem 2D que será
REM usado segurar os dados de mapa.
text 512/2,384/2, "Loading..."
LOAD BITMAP "Map.bmp",1
FOR y=0 to 1
FOR x=0 to 3
GET IMAGE 1+x+(y*4),(x*32),(y*32),(x*32)+32,(y*32)+32
NEXT x
NEXT y
DELETE BITMAP 1
FOR Y = 0 TO 12
REM Estas pequenas leituras rotineiras do DATA
FOR X = 0 TO 15
REM na ordem de mapa. Nós usaremos
READ Map(X, Y) :REM o DATA para puxar o mapa e teste
REM na ordem de mapa. Nós usaremos
NEXT X :REM onde o jogador pode e não pode
NEXT Y :REM se mover.
sync on
HIDE MOUSE
Imagem=1
FOR Y = 0 TO 12
FOR X = 0 TO 15
Imagem=Map(X,Y) +1
paste image Imagem,(X*32),(Y*32)
NEXT X
NEXT Y
LOAD BITMAP "Hero.bmp",1
FOR y=0 to 3
FOR x=0 to 2
GET IMAGE 9+x+(y*3),(x*32),(y*32),(x*32)+32,(y*32)+32
NEXT x
NEXT y
DELETE BITMAP 1
SYNC OFF
PlayerX=7
PlayerY=8
Moved = 1
X = PlayerX * 32
Y = PlayerY * 32
SPRITE 1,X,Y,16
Sair=0
SYNC OFF
repeat
sync on
IF ESCAPEKEY()=1 THEN Sair=1
if rightkey()=1 or joystick right()=1
IF Map(PlayerX + 1, PlayerY) < 5
gosub DrawBackGround
PlayerX = PlayerX + 1
Moved = 1
ENDIF: ENDIF
if leftkey()=1 or joystick left()=1
IF Map(PlayerX - 1, PlayerY) < 5
GOSUB DrawBackGround
PlayerX = PlayerX - 1
Moved = 1
ENDIF:ENDIF
if downkey()=1 or joystick down()=1
IF Map(PlayerX, PlayerY + 1) < 5
GOSUB DrawBackGround
PlayerY = PlayerY + 1
Moved = 1
ENDIF:endif
if upkey()=1 or joystick up()=1
IF Map(PlayerX, PlayerY - 1) < 5
GOSUB DrawBackGround
PlayerY = PlayerY - 1
Moved = 1
ENDIF:endif
if Moved=1
sync off
X = PlayerX * 32
Y = PlayerY * 32
sprite 1,x,y,16
Moved=0
endif
until Sair=1
rem DISABLE ESCAPEKEY
DrawBackGround:
sync on
FOR Y = 0 TO 12
FOR X = 0 TO 15
Imagem=Map(X,Y) +1
paste image Imagem,(X*32),(Y*32)
NEXT X
NEXT Y
return
cls
text 512/2,384/2, "Obrigado por Jogar!"
suspend for key
delete sprite 1
REM Abaixo de é o dados para um pequeno nível enfadonho que eu criei. Você pode
REM mudar isto ao redor de qualquer forma você quer.
DATA 5,7,7,7,7,7,7,6,6,7,7,7,7,7,7,5
DATA 5,1,1,0,0,0,0,3,3,0,0,0,0,1,1,5
DATA 5,5,5,5,5,5,5,4,4,5,5,5,5,5,5,5
DATA 6,6,6,6,0,0,0,3,3,0,0,0,1,6,6,6
DATA 6,6,1,1,1,1,0,3,3,0,1,1,1,1,6,6
DATA 2,6,6,1,1,1,1,3,3,0,1,1,1,1,6,6
DATA 2,6,6,1,1,1,1,3,3,1,1,1,1,1,1,6
DATA 2,2,6,6,1,1,1,3,3,1,1,1,1,1,0,5
DATA 2,2,2,6,6,1,1,3,3,1,1,1,0,0,5,5
DATA 2,2,6,6,6,5,5,5,5,5,5,5,5,5,5,5
DATA 2,2,6,6,5,5,5,5,5,5,5,5,5,5,5,5
DATA 2,2,6,6,5,5,5,5,5,5,5,5,5,5,5,5
DATA 2,2,6,6,5,5,5,5,5,5,5,5,5,5,5,5
What is it?
FOR y=0 to 1
FOR x=0 to 3
GET IMAGE 1+x+(y*4),(x*32),(y*32),(x*32)+32,(y*32)+32
NEXT x
NEXT y
I didn't understand. Could anyone explain me?
MM is good