Hey folks!
Just wondering if anyone has a code example of making a bomb effect with physics?
A bomb that goes off and sends an force impulse to objects around it?
Cheers!! [import]uid: 10657 topic_id: 5199 reply_id: 305199[/import]
Hey folks!
Just wondering if anyone has a code example of making a bomb effect with physics?
A bomb that goes off and sends an force impulse to objects around it?
Cheers!! [import]uid: 10657 topic_id: 5199 reply_id: 305199[/import]
Try this…
Setup a sensor, to act as a bomb.
When the sensor detects a collision have it then apply a force, directed from the centre point of the sensor outwards to the object it detected.
You can very the force with distance from the centre of the sensor.
You would make the sensor as big as the blast radius you wanted. [import]uid: 5354 topic_id: 5199 reply_id: 17252[/import]
search around on the box2d forums. i did this in one of my flash prototypes, basically checking distance/direction from the sensor and applying a force to each nearby object accordingly
http://www.eventdispatcher.fr/2009/11/25/physexplosion-explosion-method-for-box2d-as3/
http://www.box2d.org/forum/viewtopic.php?f=3&t=601
http://www.cocos2d-iphone.org/forum/topic/2079
http://www.box2d.org/forum/viewtopic.php?f=4&t=1597
[import]uid: 6645 topic_id: 5199 reply_id: 17294[/import]
Thanks guys!
I’m trying right now! Trying to port cocos2d to corona!! [import]uid: 10657 topic_id: 5199 reply_id: 17532[/import]
Anyone has any sample code of how this is done? [import]uid: 15629 topic_id: 5199 reply_id: 17726[/import]
Could you give an example in code how to do this please? [import]uid: 21962 topic_id: 5199 reply_id: 19342[/import]
Kaboooom
http://mobile.tutsplus.com/tutorials/corona/corona-sdk_physics_explosions/
Haven’t tried it yet ! But looks alright!! [import]uid: 10657 topic_id: 5199 reply_id: 20749[/import]