Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › How to detect Kinematic components going out of the scene?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #8639

    Martin

    My game is a “platformer”, so I have platforms regularly travelling “out of” my scene.

    I’m not sure the best way to detect this situation.   I have “walls”, like the Stack the Box example, which keep players and dynamic objects in the scene, but since platforms  are Static (because they can’t be affected by things hitting them, and they are not supposed to collide with each other), the platforms just float right through the walls undetected.

    At the moment I have a timer scanning the list of platforms for ones that are out of play and deleting them (they are pooled).   Having a timer and scanning the whole list of platforms seems unduly expensive: I’m not at all keen on it.

    Is there a better way?

    • This topic was modified 9 years, 9 months ago by  GreenAsJade.
    • This topic was modified 9 years, 9 months ago by  GreenAsJade.
    #8659

    Alex
    Felgo Team

    Hi,

    what we are doing in our Chicken Outbreak platformer example is using Dynamic bodies with collisionTestingModeOnly enabled. This makes them sensors that are not affected by any physics, and since they are still Dynamic they detect collisions with Static bodies. Have a look at the BorderRegion entities of the Chicken Outbreak example. You can add those sensors just far enough outside of the screen to make your platform fully leave it and then destroy them upon contact.

    Cheers,
    Alex

    #8660

    Martin

    Thanks, perfect!

    Cheers,

    Martin

     

    #8661

    Martin

    No, wait, that’s no good 🙂

    The platforms can’t be sensors only: the player has to stand on them, and falling things have to bounce off them…

     

     

    #8664

    Alex
    Felgo Team

    No, the platforms stay static, we only add Dynamic sensors outside the screen to detect collisions with those static bodies leaving the screen.

    #8665

    Martin

    Hah – thanks!  Silly me!

     

Viewing 6 posts - 1 through 6 (of 6 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded