How to create a bullet or a throwable stone ?

22 January 2015 03:31

In the BGE it is easy an ALWAYS sensor is connected to a movement actuator. When the player fires his weapon the bullet object is dynamically created then the physics system handles the impact if needed or a simple collision test is made.

In B4W, I was perusing the API, there is no ALWAYS sensor. So how to do something similar when we want to perform an action at each frame ?

22 January 2015 10:46

The main concept when programming logic for B4W is not a sensor but a sensor manifold. As you can see from documentation there is a special type of manifolds: CT_CONTINUOUS. It is pretty useful when combined with the elapsed sensor.

Examples can be found in the game tutorials:
Part 1 - here the character turn is based on CT_CONTINUOS sensor manifold.
Part 5 - Falling rocks are based on this type of manifolds.
Please register or log in to leave a reply.