How do I use the GravityInteractor properly on Hermes Game Engine?

edited July 2014 in Library Questions

I'm looking at using the GravityInteractor so that objects within the world will be forced to adhere to gravity.

There isn't much of a description within the docs as to how to use it, and I can't find an example that utilises the class.

Does anyone have an example or explanation of how to properly implement the class?

Thanks.

Tagged:

Answers

  • Answer ✓

    You don't need to use this class to simulate gravity. Look at the PlatformExplorer example that comes with the library. In the Player tab you can see gravity being applied in the update() method.

  • Ahhh right, I mustn't have checked the examples very well!

    Thanks!

  • As a quick word of explanation:

    "GravityInteractor" is for creating planetary-like gravity attraction between two objects. It's useful for creating things like a solar system simulator or space puzzle game.

    It sounds like you're looking for a different kind of gravity, ie. a set force applied to all objects in a set direction (presumably downwards, but maybe not). As answered, "update()" is the simplest way to accomplish this.

Sign In or Register to comment.