VBGamer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
Movement between tiles Leo (2 replies, 0 views) (2000-Jul-9) Hi!
My name is Leo, and I'm working on a "top-viewed" game. I made a map editor, and it works. It also works to load the map-file into the game. My problem is that when I want to move the character, the only way I got to work, is to move him a whole tile at once. This looks very ugly since the size of the tiles is 32x32.
I've tried other ways such as let the character "glide over" to the next tile, but that didn't look good either, and if you pressed up 3 times the character moved 3 steps up, but it took a while. I want to be able to hold in a key, and then the character should stop moving when I release the key. I also tried to make the character move in small steps, and making the position on the tiles change after a number of steps, but that didn't work either. I use one variabel for the tiles that look like this:
Dim Tile(1 to 15, 1 to 13) As Integer
I have a class for the character which has two variabels that looks like this:
Public MapXPos as integer
Public MapYPos as integer
Those variabels change by 1 or -1 at a time when you press down a key.
If you give me an answer, then please try to stick to these variabels, and please explain it good, so that it's easy to understand.
I would be VERY thankfull for an answer!!!
/Leo
|