Reflecting collisions

This forum is currently in read-only mode.
  • For the project I'm working on, I need to make objects 'bounce' off a circle (reflect at their angle of incidence). I came up with a solution that works reasonably well, with a few odd glitches - pretty sure I could work those out. Unfortunately, it also crashes the runtime sometimes, which is a deal-breaker.

    [I know, crashes are always bugs! Submitted to the tracker.]

    Does anyone have an alternative method? Surely there's a neat trigonometry solution to this. Hell, I was kind of surprised it was possible to do without trig.

    http://dl.getdropbox.com/u/906550/bouncetest-02.cap

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't have Construct installed in this laptop but I did tackle this issue once.

    However..... on second thought .... I was reflecting from a flat surface. Still I'm pretty sure it involves ATAN2

    I had this huge trigonometric expression only to figure out later that Construct had it built in.

  • If that method worked, I guess it's time I learned more about trigonometry.

    I've definitely had the 'oh, it's built-in!' experience with Construct - making this, I was kind of struggling until I found the 'Angle is clockwise from' system condition.

  • see my post near the end of this thread

    theres a long explanation, and an example cap:

    scirra.com/phpBB3/viewtopic.php?f=2&t=4169&start=10

  • Wow. Okay, your way uses less events, detects more reliably, runs faster, and doesn't crash. Thanks, Lucid!

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