[Solved]

Get help using Construct 2

Post » Tue Sep 16, 2014 9:47 pm

________________________________________________________________________
Last edited by vitorfgd on Sun Sep 21, 2014 6:48 pm, edited 1 time in total.
B
12
S
3
G
1
Posts: 188
Reputation: 1,377

Post » Tue Sep 16, 2014 10:01 pm

Something like this should work:

give the circle an instance variable a

on circle touched set a to abs(circle.angle-angle(circle.x,circle.y,touch.x,touch.y))

touch is touching circle - circle set angle : angle(circle.x,circle.y,touch.x,touch.y)-a

could be I've made a mistake somewhere, but what I'm trying to do is get the offset between circle.angle and the angle towards touch and use that offset while moving the finger..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Sep 17, 2014 12:10 am

----------------------------------------------------------------------------
Last edited by vitorfgd on Sun Sep 21, 2014 6:49 pm, edited 1 time in total.
B
12
S
3
G
1
Posts: 188
Reputation: 1,377

Post » Wed Sep 17, 2014 8:28 am

The code should have been:

on circle touched set a to circle.angle-angle(circle.x,circle.y,touch.x,touch.y)

touch is touching circle - circle set angle : angle(circle.x,circle.y,touch.x,touch.y) + a

Fixed it in this capx
You do not have the required permissions to view the files attached to this post.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Sep 17, 2014 5:23 pm

--------------------------------------------------------------------------------------------
Last edited by vitorfgd on Sun Sep 21, 2014 6:49 pm, edited 1 time in total.
B
12
S
3
G
1
Posts: 188
Reputation: 1,377

Post » Wed Sep 17, 2014 5:55 pm

--------------------------------------------------------------------------------
Last edited by vitorfgd on Sun Sep 21, 2014 6:49 pm, edited 1 time in total.
B
12
S
3
G
1
Posts: 188
Reputation: 1,377

Post » Wed Sep 17, 2014 6:03 pm

They are probably using some form of interpolation, in my capx the angle is set every tick to the position of the finger..
To have the circle move on release will take some math I'm not so good at..
Could try to create it, but don't really have the time for that now, sorry..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Sep 17, 2014 6:21 pm

Don't worry, I'll try on my own, otherwise I'll talk to some more people ^^
Thank you for all your help ^^
B
12
S
3
G
1
Posts: 188
Reputation: 1,377

Post » Wed Sep 17, 2014 7:12 pm

B
94
S
33
G
114
Posts: 5,359
Reputation: 73,779

Post » Wed Sep 17, 2014 7:32 pm

---------------------------------------------------------------------------------------
Last edited by vitorfgd on Sun Sep 21, 2014 6:50 pm, edited 1 time in total.
B
12
S
3
G
1
Posts: 188
Reputation: 1,377

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests