How do I let a object make a specific path

  • Hi all!

    I got a question and im not pretty sure how to do it.

    I need to make a object go trough a other object in a random specific path.

    Ok in text i can never get it clear so here is a picture:

    The red dot is object 1. Always at the same location located in the center.

    I need the blue object to kinda get warped into it and get back. Just like gravity. The thing is i have no clue how to do this.

    The yellow lines are example paths that the blue object can take.

    So to make it even a little harder, the blue object has to get a random speed once it passes the red object.

    This means that every "warp" will have a different outcome.

    You can take this example as the world. Once you go up you will go down but this time there is nothing to stop you.

    So as real life example:

    You jump up into the air for 1KM height.

    You fall down and when you get that 1KM back you wont be splashed to earth but you will get shoot out the other half of the world where you, for example, jump up another 2KM.

    I hope i made myself clear. I Really could use some help on this one!

    Thanks in advance!

    After a while i thought it would be really hard to understand my explanation.

    So, try 2.

    You can see it as a invisible bungee rope between the blue and the red object, but with more speed.

    Once it has fallen down the object has to bungee back up, in any direction as long as it passes the red object.

    This has to continue. The room has no bottom and no top, it has to be like a circle with gravity going in a shockwave out.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here are some examples that can get you started.

    The "Orbits" is the simplest one (because this is as far my mind can get me

    The other two examples were made by R0J0hound (I don't remember from which topics I took them) and I think that I renamed them. If you can decipher the logic behind his magic, I bealive you can create whatever result you wish. He basically emulates real world gravity between objects!

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