I have a tile based game I'm playing around with, but am having some issues getting the player to move correctly.
The tiles and character are 32pix square.
Player can move in the 4 main directions.
There is a slight (.1 sec) delay before the character starts to move, that way the player can look in a direction without moving in that direction right away.
the character moves by pixels (so moves 32 pixels per tile)
the character finishes moving even if direction key is no longer pressed, so if the player is halfway through a tile the animation needs to finish them into the next tile before stopping.
I can manage the delay and direction but when(IF) the character starts moving they don't stop until the array errors out. I've tried using TIMERs, I've try using flags, its just not working for me. Can't shut down the whole execution to move the player cause there are other NPCs that need to be able to move in time with the player. so this has to happen 'in flow' EX;
Do
control routine...
if player moving then do frame of movement...
if NPCs are moving then move NPCs a frame of movement....
do other house keeping....
build screen....
display screen...
delay...
Loop until quit
and execution needs to be constant.
I can get it to move by whole tiles, I just can't get the 32pixel walk to work. and I'm at my wits end with this. I really need help with the mechanics of that part, the controls, graphics, and final movement I can get, it is just that 1 phase that is not working.
Bplus, [banned user], Steve, you guys have any ideas?