Touch steering stutters
eberlepeter
Member, PRO Posts: 8
in Tech Support
Hi guys.
In my game I have a problem with the steering of my actor (rocket).
I used the following commands to steer the rocket:
The problem is: Once the rocket reached the touch location you cant move your finger to a new position on the cscreen and the rocket follows...
You always have to lift the finger and touch again on an other point of the screen. Then it works.
Since I wanna creat a game for kids, thats a problem, because it makes the steering harder and not so smoothly.
Does anyone have an idea how to work around this?
Thanks in advance mates!
Keep on gaming!
Comments
You don't need the three conditions that say:
When Touch is Outside + When Touch is Inside + When Touch is Pressed
That's the same as saying 'When Mouse Button is Down'.
. . . . . . . . . .
For the movement issue, trying replacing your rules with the following:
When Mouse Button is Down
--Constrain Linear velocity X to 5
*
(Mouse.X -self.X)--Constrain Linear velocity Y to 5
*
((Mouse.Y +76)-self.Y)Otherwise
--Change Linear velocity X to 0
--Change Linear velocity Y to 0
. . . . . . .
And here's the same thing if you want to include Rotation:
When Mouse Button is Down
--Constrain Linear velocity X to 5
*
(Mouse.X -self.X)--Constrain Linear velocity Y to 5
*
((Mouse.Y +76)-self.Y)--Constrain Rotation to vectorToAngle(Linear velocity.X,Linear Velocity.Y )
Otherwise
--Change Linear velocity X to 0
--Change Linear velocity Y to 0
Example Project Attached:
Thanks a lot!
You really helped me out!
The steering is much better now.
Play around with the '5' value to tighten or loosen the feel of the tracking.
Yeah thats what i did and I found a sweet spot.
Thanks. It made my App much better.