First I’ll try and explain best I can what I’m trying to achieve. What I’m creating is a grid based game where the main character moves smoothly between each grid on a keystroke. What I want is if the player is still pressing the key after the character has reached the first square I want it to continue into the second.
This is the code I’m using atm
tester = False
if(self.keyMap["left"]!=0 and not tester):
tester = True
myInterval1=LerpPosInterval(PodInit.pod,1.0,
Point3(PodInit.pod.getX()-6,50,0))
myInterval1.start()
if(myInterval1.isStopped()):
tester = False
myInterval1.finish()
What this does is when I press the key the character rockets off to like -30, when in reality I only want it to go to -6.
Another attempt was this
if(self.keyMap["left"]!=0):
myInterval1=LerpPosInterval(PodInit.pod,1.0,Point3
(PodInit.pod.getX()-6,50,0))
if(myInterval1.isStopped()):
myInterval1.finish()
myInterval1.start()
What this one does is on pressing the key the player moves to -6 and stops. Then on each keystroke moves an additional -6. Making it look lurchy.
Any help would be appreciated!
Thanks!