moving a number around on a bitmap
Posted: Fri Aug 18, 2006 12:12 pm
Hi all. I'm trying to make a turn-based, puzzle style game that runs on a tile-based map. The player is a bit on a map, just like the walls and objects are. My code isn't working, though.
The 'up' and 'down' code follows. Up works, but down does not. They look exactly the same to me, so if anyone can tell me why down isn't working, I'd greatly appreciate it. I've run into the same problem when trying to use the 'right' key, too. I know I'm missing something really simple.
Map is a 20x12 array. I'll gladly post more code if needed. thanks in advance!
The 'up' and 'down' code follows. Up works, but down does not. They look exactly the same to me, so if anyone can tell me why down isn't working, I'd greatly appreciate it. I've run into the same problem when trying to use the 'right' key, too. I know I'm missing something really simple.

Map is a 20x12 array. I'll gladly post more code if needed. thanks in advance!
Code: Select all
IF k$ = "u" THEN
FOR y = 0 TO 11
FOR x = 0 TO 19
IF map(x, y) = 2 THEN
map(x, y) = 0
map(x, y - 1) = 2
END IF
NEXT x
NEXT y
END IF
IF k$ = "d" THEN
FOR y = 0 TO 11
FOR x = 0 TO 19
IF map(x, y) = 2 THEN
map(x, y) = 0
map(x, y + 1) = 2
END IF
NEXT x
NEXT y
END IF