Forums

OverviewV-Play 1 Support › Check if entity has stopped moving

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4552

    Saims

    Hi,

    I wanted to know whether there is a possiblity to check if an entity has stopped moving?

    My Situation is as follows. The balls we shoot at birds get removed after they touch an invisible border at the bottom of the field. Now we have levels in which the balls are used e.g. to close gaps or maybe later on to activate a switch. In this case, they will never fall down and will never get removed. My problem is now, that our game ends, when all the balls are removed -> so the game never ends.

    And thats why I need to find out whether the ball has stopped moving, cause it is in a gap or on a switch, so that i can decrement our shotsInTheAir variable and the game ends without these balls being actually removed.

    #4557

    Christian
    V-Play Team

    Hi Saims,

    you could use the active property of BoxCollider to detect if a physics body is moving or not. You could disallow an entity getting inactive by setting the sleepingAllowed property to false, but by default it is true.

    Another approach might be, to not only decrement your shotsInTheAir counter when the balls are colliding with the border, but also when they collide with the other physics objects where they can come to a halt. Or you start a timer after issuing the last shot and stop your game if either all balls are out of range, or the timer is finished whatever comes first.

    Cheers, Chris

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

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support