How do I Fix this analog problem

Just started using Construct 2? Post your questions here

Post » Wed Feb 25, 2015 6:20 am

Hi
I made analog controller on layer 1 and parallax is 0,0.
Game run smoothly early then the analog become bad when player at middle of layout/Right side, that because touch.X and touch.Y is always more than analog.X right?
How to fix that?
Sorry for my english -_-
thank you so much
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 24
Reputation: 448

Post » Thu Feb 26, 2015 11:22 am

Problem is that your different paralax is influencing touch.x and y.
Thats why you must take it into account.
Adding scroll.x/y - originalwindowheight/width should do it, I believe.
Try to put into your line 4 this expressions:

angle(Touch.X - (scrollx - OriginalWindowWidth/2), Touch.Y - (scrolly - OriginalWindowHeight/2), Gear.X, Gear.Y)

min(abs(distance(Touch.X- (scrollx - OriginalWindowWidth/2), Touch.Y- (scrolly - OriginalWindowHeight/2), Gear.X, Gear.Y)) / 1, 100)
B
12
S
6
G
2
Posts: 99
Reputation: 1,727

Post » Thu Feb 26, 2015 2:45 pm

razorMonkey wrote:Problem is that your different paralax is influencing touch.x and y.
Thats why you must take it into account.
Adding scroll.x/y - originalwindowheight/width should do it, I believe.
Try to put into your line 4 this expressions:

angle(Touch.X - (scrollx - OriginalWindowWidth/2), Touch.Y - (scrolly - OriginalWindowHeight/2), Gear.X, Gear.Y)

min(abs(distance(Touch.X- (scrollx - OriginalWindowWidth/2), Touch.Y- (scrolly - OriginalWindowHeight/2), Gear.X, Gear.Y)) / 1, 100)

thank you for help.
I already solved this problem last night, it's just add layer index after touch.X and touch.Y so it's look like = touch.X(2),touch.Y(2), Gear...
:D
B
6
S
1
Posts: 24
Reputation: 448

Post » Fri Feb 27, 2015 6:16 am

@ramagoi
Did not know that. Thanks for your info. ;)
B
12
S
6
G
2
Posts: 99
Reputation: 1,727


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest