Scroll with Inertia issue (touch controls)

Get help using Construct 2

Post » Mon Jul 10, 2017 12:13 pm

Hi all,

I've been following https://www.scirra.com/tutorials/560/sw ... th-inertia to set up a simple "scroll controls" test but have run into the following issue:

When following the instructions it works perfectly, that is, until I try and reverse the Direction of movement ("Direction: By adding or subtracting ‘self.DiffX’ to ‘self.X’ (and self.DiffY to self.Y), you can change the direction of the scroll depending on your game needs."). When I've inverted the addition to subtraction I get a strange bug every few swipes where the DiffX and DiffY values are clearly wrong and the scroll goes bouncing back towards (sometimes beyond) the origin of the swipe instead of away from it.

It's quite hard to explain. Please see the .CAPROJ file below:

https://ufile.io/s4e14

To recreate the issue:
- Load the Caproj and Start the project
- Use a touch screen to swipe left, right, up and down
- Eventually you will be "rebounded" back in the direction of the origin of the touch (infrequent)

Thankyou,
Greg
Last edited by Lncredible on Tue Jul 11, 2017 11:25 am, edited 1 time in total.
B
8
S
2
Posts: 59
Reputation: 686

Post » Tue Jul 11, 2017 7:30 am

Bump! Please help!
B
8
S
2
Posts: 59
Reputation: 686

Post » Tue Jul 11, 2017 7:41 am

Probably best to post a .capx showing the problem, as it allows those who can help a quick way to both understand and (hopefully) rectify the issue - especially as you note that your problem is "quite hard to explain".

Be aware that the time users have to help may be limited (due to work, life etc) so asking them to go through a tutorial to understand your problem may be a little too much.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
84
Posts: 5,386
Reputation: 58,454

Post » Tue Jul 11, 2017 11:26 am

zenox98 wrote:Probably best to post a .capx showing the problem, as it allows those who can help a quick way to both understand and (hopefully) rectify the issue - especially as you note that your problem is "quite hard to explain".

Be aware that the time users have to help may be limited (due to work, life etc) so asking them to go through a tutorial to understand your problem may be a little too much.


You are quite right. I've posted a .capx project file above for anyone who has some time to help.
B
8
S
2
Posts: 59
Reputation: 686

Post » Thu Jul 13, 2017 10:37 pm

I had this issue as well.
I solved it by simply using replacing the touch.x or touch.Y on the events to Touch.Absolute.

Try it and post your result :)
B
26
S
14
G
8
Posts: 49
Reputation: 6,250


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests