Grid based movement
by James Mintram · in Torque Game Engine · 10/27/2008 (4:20 pm) · 2 replies
Hi there, I am not too clued up on the inner workings and best proctices with TGE so I am posting here hoping to get some help and advice.
I am looking to write a game where a player navigates a grid using the directional keys, now the thing I am trying to figure out is how to implement the grid based movement.
What I mean by that is keeping the player "locked" to grid positions, so the player might be at 0,0,0 and the player presses foward. The keyboard is then "locked" and the character moves to 1, 0, 0 over x amount of time, once the character has reached that position keyboard control is returned and the player can move again.
I hope you can understand what I am trying to get at!
Many Thanks
James Mintram
I am looking to write a game where a player navigates a grid using the directional keys, now the thing I am trying to figure out is how to implement the grid based movement.
What I mean by that is keeping the player "locked" to grid positions, so the player might be at 0,0,0 and the player presses foward. The keyboard is then "locked" and the character moves to 1, 0, 0 over x amount of time, once the character has reached that position keyboard control is returned and the player can move again.
I hope you can understand what I am trying to get at!
Many Thanks
James Mintram
About the author
Torque Owner Andy Rollins
ZDay Game
One of the easiest ways of achieving this is to use the AIPlayer class instead of the player class as your controllable object... then you have access to the moveTo() function and can control the player that way.