Here's how I would do it:
Put this at the beginning of your code:
rem values for 'snap to grid'
matrix_size_x=640
tiles_x=64
tilesize_x#=matrix_size_x/tiles_x
matrix_size_y=440
tiles_y=44
tilesize_y#=matrix_size_y/tiles_y
Then this code will store the tile you are on in the variables x and y:
pos_x#=(char_matrix_x#/tilesize_x#)+1 :`change char_matrix_x# to char x position
pos_z#=(char_matrix_y#/tilesize_y#)+1 :`likewise here
x = int(pos_x#)
y = int(pos_z#)
You are the
th person to view this signature.
Programmers don't die, they just
Gosub without
return....