need help with complex drag / offset issue

0 favourites
  • 7 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • 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

    Subscribe to Construct videos now

    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

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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

  • Error snipe. Disregard. See below.

  • awesome examples thanks! that should do the trick!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)