Forum

How to create a bullet or a throwable stone ?

22 January 2015 03:31 #1129
Hi,

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 ?

Thx.
http://www.JPfeP.net
22 January 2015 10:46 #1131
Hi,

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.
Blend4Web developer
 
Please register or log in to leave a reply.