need help with complex drag / offset issue

Get help using Construct 2

Post » Thu Mar 27, 2014 5:36 pm

Hi there,

I'm working on a box flicking game and have most of it working, but there is a tad bit of sloppiness that I would like to find a solution for.

this is what i have with C2 so far.. http://part12studios.com/temp/fredex2/

I made this in gamesalad https://www.youtube.com/watch?v=DYe4QtD6bGs and want to recreate it with C2 but you see how the boxes tend to be fluid and not so prone to freaking out if i move them slow sometimes...


The big issue is notice how in the C2 version (first link) when you move slowly.. see how it violently shimmies? I would like that to not happen either. would just like it to naturally flow like the youtube example does.


I'm hoping there is a way to calm the boxes down a little, but not be a cpu intensive solution.


Thanks!
Caleb
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Post » Thu Mar 27, 2014 6:46 pm

what are you doing with the boxes when drag is on? are you changing angles? are you using drag and drop behavior? it like something is resetting the objects angle..

any modification that is not in the physics sense, can make physic-objects react irregular, but maybe just setting x and y to mouse could work

edit: its probably more a question of how are you setting the angle of the object, i think your youtube example is using a complete physic solution to drag the boxes, you could get the angle of motion, and try to turn the object in that direction with physics
ImageImage
B
71
S
22
G
7
Posts: 827
Reputation: 10,177

Post » Fri Mar 28, 2014 4:51 am

I've linked the project here if you want to see first hand, but in a nutshell, yea i'm doing a:

angle(box.X, Box.Y, touch.X, touch.Y)

the fling effect is achieved doing a:

physics impulse distance(box.X,box.Y,Touch.X,touch.Y)/2

https://www.dropbox.com/s/7a1ci9k5k2n30 ... tup%29.zip

so yea if I follow you correctly, I'm not using physics to set direction and don't know how to do that. Any suggestions? I tried things like Physics Force At Angle (not sure i'm using any of them right) but it didn't seem to yield any results.
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Post » Fri Mar 28, 2014 6:07 pm

the problem is when you stop moving, the angle always return to 0, because there is no difference between box and touch coordinates

you will need some check to only set angle when you are actualy dragging the box
ImageImage
B
71
S
22
G
7
Posts: 827
Reputation: 10,177

Post » Fri Mar 28, 2014 7:01 pm

Error snipe. Disregard. See below.
Last edited by droptank21 on Fri Mar 28, 2014 8:59 pm, edited 2 times in total.
B
22
S
9
G
3
Posts: 203
Reputation: 3,653

Post » Fri Mar 28, 2014 7:08 pm

ImageImage
B
71
S
22
G
7
Posts: 827
Reputation: 10,177

Post » Fri Mar 28, 2014 9:05 pm

awesome examples thanks! that should do the trick!
B
59
S
9
G
1
Posts: 970
Reputation: 6,611


Return to How do I....?

Who is online

Users browsing this forum: FabianB, Seruza and 8 guests