TGB/MiniTutorials/ExplodingObjects
From TDN
| Exploding Objects with Particle Explosions | |
|---|---|
Description: This sample script will load an explosion particle effect upon your object's collision. |
|
|
function ExplodingShip::onCollision( %srcObj, %dstObj, %srcRef, %dstRef, %time, %normal, %contactCount, %contacts )
{
// create a new particle effect
%eff = new t2dParticleEffect() { scenegraph = %srcObj.scenegraph; };
// load in our shockwave explosion and set its position to our source object's position
%eff.loadEffect("~/data/particles/shockwave_burst.eff");
%eff.setPosition(%srcObj.getPosition());
%eff.playEffect();
// delete our exploding object
%srcObj.safeDelete();
}
|



