I can display, save, and check the tile map.
But I can't seem to get my player to move around it, while checking for values of a square that he CAN move on.
Code:
I'm using simple 8x8 sprites for the player and other tiles.
How would I check for the adjacent tile, and if a certain value, then move there, otherwise, do nothing?
Edit by Merth: Moved to General Programming forum, since this isn't z80 asm.
But I can't seem to get my player to move around it, while checking for values of a square that he CAN move on.
Code:
.Drawing the map
For(A,0,11)
For(B,0,7)
If {B*12+A+L₁}=1
Pt-On(A*8,B*8,Pic1)
End
End
End
.Game Loop
Repeat GetKey(15)
getKey→K
DispGraph
Pt-On(X,Y,Pic2)
...
I was going to use this
to help with checking for
a to the adjacent spot
from where the player
will be moving.
...
X/8→A
Y/8→B
.Movement code
.This is what I was hoping to work, but it didn't.
If K=1 and {B+1*12+A+L₁}
Pt-Change(X,Y,Pic2)
Y+8→Y
End
...
The rest of the movement code
went here, but it doesn't work.
...
I'm using simple 8x8 sprites for the player and other tiles.
How would I check for the adjacent tile, and if a certain value, then move there, otherwise, do nothing?
Edit by Merth: Moved to General Programming forum, since this isn't z80 asm.