[Solved]How do I clamp a sprite within a circle, mouse moved

Get help using Construct 2

Post » Fri Jun 24, 2016 2:26 am

Hi, I'm trying to create a slingshot system where when the player pulls back the slingshot, it revolves in a smooth semi-sphere behind the slingshot.

I've manage to accomplish this in a box shape working, but I need the smooth movement along a semi-circle, or full circle when the mouse is outside of the range. Try the demo to understand what I mean:

https://dl.dropboxusercontent.com/u/44188718/C2%20Exports/slingshot/0.0.1/index.html

I found this, and am working on it to help me: https://www.scirra.com/forum/viewtopic.php?f=147&t=73855&p=616646&hilit=circle+clamp#p616646 but I unfortunately I just can't figure this out right now.

Does anyone know how to accomplish this, or have ideas to approach? I'm totally stuck at the moment.

Here is the .capx: https://dl.dropboxusercontent.com/u/44188718/Temp/slingshot.capx

Thanks for any help! :D
Last edited by Reflextions on Tue Jun 28, 2016 7:40 pm, edited 1 time in total.
B
72
S
24
G
11
Posts: 452
Reputation: 12,387

Post » Fri Jun 24, 2016 4:16 am

Not perfect, but should give you an idea:
https://dl.dropboxusercontent.com/u/659 ... ircle.capx
ImageImage
B
114
S
51
G
24
Posts: 790
Reputation: 23,480

Post » Sun Jun 26, 2016 1:01 am

You could try something like that (edited capx)
Image Image
B
26
S
15
G
142
Posts: 881
Reputation: 74,060

Post » Tue Jun 28, 2016 7:40 pm

MadSpy wrote:You could try something like that (edited capx)


That works perfectly. Thanks!
B
72
S
24
G
11
Posts: 452
Reputation: 12,387


Return to How do I....?

Who is online

Users browsing this forum: LaurenceBedford and 7 guests