# [BEHAVIOR] Chipmunk Physics

### » Thu Feb 25, 2016 8:44 pm

@AnD4D

That could be achieved by setting force (polar) to

force : max amount - clamp(distance(object.x,object.y,blackhole.x,blackhole.y),0,max amount)
angle : angle(object.x,object.y,blackhole.x,blackhole.y)
B
72
S
26
G
10
Posts: 184
Reputation: 8,345

### » Thu Feb 25, 2016 9:35 pm

I use chipmunk for the joint capabilities, here is something I was working on last year:
B
51
S
24
G
68
Posts: 1,190
Reputation: 40,356

### » Sat Mar 05, 2016 1:41 pm

Please someone help me, I have a falling box with physics behavior i want to change his direction when i swipe, the box will move to right or to left and continue to fall as the image below
Im using chipmunk plugin
B
5
Posts: 27
Reputation: 281

### » Sat Mar 05, 2016 2:51 pm

Hello @MarkeGamer,

I've never used the touch but, basicaly I think just check the direction of the touch (with somethin like touch start and touch end, I don't know) and apply an impulse with Chipmunk physics at that direction or an angle (switch to polar when setting the impulse).
B
16
S
5
Posts: 137
Reputation: 1,489

### » Sat Mar 05, 2016 3:05 pm

MarkeGamer you could do it like

is in touch Box Set angle towards (touch.x)
(Touch.y)
B
265
S
49
G
15
Posts: 2,028
Reputation: 42,728

### » Sat Mar 05, 2016 3:08 pm

Nabu0001 wrote:Hello @MarkeGamer,

I've never used the touch but, basicaly I think just check the direction of the touch (with somethin like touch start and touch end, I don't know) and apply an impulse with Chipmunk physics at that direction or an angle (switch to polar when setting the impulse).

Thanks for reply can you please give me a sample example if you want im newbies in construct 2
B
5
Posts: 27
Reputation: 281

### » Sat Mar 05, 2016 3:10 pm

Lordshiva1948 wrote:MarkeGamer you could do it like

is in touch Box Set angle towards (touch.x)
(Touch.y)

please can you tell me how with an example coz im a newbie in construct 2
B
5
Posts: 27
Reputation: 281

### » Sat Mar 05, 2016 4:24 pm

MarkeGamer you will find demo here and many more as you are newbie in construct 2

https://www.dropbox.com/s/djjowh9avzqpb ... .capx?dl=0
B
265
S
49
G
15
Posts: 2,028
Reputation: 42,728

### » Sat Mar 05, 2016 4:55 pm

Message: MarkeGamer can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Lordshiva1948 wrote:MarkeGamer you will find demo here and many more as you are newbie in construct 2

https://www.dropbox.com/s/djjowh9avzqpb ... .capx?dl=0

Firstable thanks for your reply in fact it's almost what i need except one thing i want the green box, falling down to the bottom even when i change his direction as you did in your code
B
5
Posts: 27
Reputation: 281

### » Sat Mar 05, 2016 8:26 pm

MarkeGamer See Falling demo again and let me know is that what you want?

https://www.dropbox.com/s/8d2a8zt685mf8 ... .capx?dl=0

many more as you are newbie in construct 2

https://www.dropbox.com/sh/eioscti86bpr ... 7YPza?dl=0
B
265
S
49
G
15
Posts: 2,028
Reputation: 42,728

PreviousNext