Specified distance each keystroke? [Solved]


What I’m trying to do is create a grid base game. So what I need is to have the player model move a specified distance each keystroke. Pretty much from the center of one grid square to the center of the next.

I’ve tried this:

		self.keyMap["left"] = 0
		while( prevPosX >= newPosX):
			elapsed = globalClock.getDt()
			prevPosX = prevPosX-(elapsed*.25)

It works to a degree. The problem is that it makes the movement seem almost instant when I run the program. I’m looking for a gradual movement.

Any help on this would be awesome!



I did some further reading in the manual and discover the intervals. This does exactly what i want.