Object slide away

0 favourites
  • 8 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • How to create objects for a top down game in which when the player collides with them, they just bounce off to a certain distance? And other one : How to push objects away when u collide with them?

  • There are Physics objects. And also there is a Custom movement behaviors with a "Push out solid". Tinker with them and you may come up with something.

    You might use a bullet behavior, and have it enabled for a few seconds after the player collides with it. Once the player collides with it, have it enable bullet, and the bullet set angle -180 degrees from the players angle. leave bounce off solids enabled, and after the timer is up, disable the bullet so it eventually stops. You can use the bullet distance traveled to start a fadeout, or just destroy them too.

  • Tried using bullet as you explained and I tried using push out solid, neither worked for me, thanks anyway.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I guess you'd have to creat a player on collision with object event..

    If you want the player to bounce of of the object, using the bullet behaviour as described above should work perfectly, if implemented right..

    Another way would be to use any other kind of movement behaviour, or even code your own movement..

    Just be sure to disable user input for the normal behaviour..

    to push something on collision, you could add the pin behaviour..

    Adding an is pinned, player set speed to 0.5 * the normal speed or something..

    There are so many ways to achieve the wanted results, depending on your needs and wishes, you'd have to be more precise as to what you want and how your events are set up right now, to get a better explanation..

  • Here ya go: Derock

    UPDATED BELOW

    Sorry for the -180 thing. I dont know what I was thinking.

    You can do the same concept with a physics object. Make sure you disable them when you dont actually need them, so the CPU can do other things in the game.

    The best design would have static Proxy balls that the player triggered, then the proxy Destroys and the bullet spawns... When it gets too slow it spawns another proxy and destroys itself.

    Can make a neat soccer/football game with the above template. There is a lot of great controls for the bullet.

    This method is also great because the player is not a Solid, or a physics object! This is a MAJOR mistake new people make.

    Like LittleStain was explaining, there are lots of ways to get the look you are after. The hard part is picking the right one for your situation.

  • Derock

    OK here is an update!

    https://mega.nz/#!pZ5HxYDS!LOhvtXixVcuJ ... Whfi-RT-Us

    I added boxes with an "avoidance" script. All of the things it avoids are in the NoOverlap family.

    The balls also do an avoidance to No-Overlap. This makes a really CPU cheap fake physics system.

    The boxes are not solid, nor are they Physics objects or Bullets.

    You can use collision at offset too, but that gets really expensive , really fast.

    LittleStain That Pin thing is brilliant! I am going to use it sometime <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • jojoe Thanks man for everything, but unfortunately it says that the link above is broken

  • Crap, no idea what went wrong, here is a new link:

    https://mega.nz/#!FMAmjABQ!TCDEeNrkPNK2 ... vp9F3ONIjM

    Let me know if that works for you Derock

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