I have an image moving across the bottom of the screen. When I move press the left cursor the image moves at the correct speed. When I press the right cursor the image take a second longer to travel the width of the screen.
Code Below:
Image type variable:
Field Speed#=640/4
Image type update method:
If KeyDown(KEY_LEFT)
X :- self.Speed*DeltaTime
EndIf
If KeyDown(KEY_RIGHT)
X :+ self.Speed*DeltaTime
EndIf
In the main loop:
DeltaTime = ( MilliSecs()- TimeDelay )*0.001
TimeDelay = MilliSecs()
I don't know what is going on.
Thanks in advance.
Mark
Code Below:
Image type variable:
Field Speed#=640/4
Image type update method:
If KeyDown(KEY_LEFT)
X :- self.Speed*DeltaTime
EndIf
If KeyDown(KEY_RIGHT)
X :+ self.Speed*DeltaTime
EndIf
In the main loop:
DeltaTime = ( MilliSecs()- TimeDelay )*0.001
TimeDelay = MilliSecs()
I don't know what is going on.
Thanks in advance.
Mark