Showing posts with label Monster Truck. Show all posts
Showing posts with label Monster Truck. Show all posts

Wednesday, 1 August 2012

Cocos3d, Explosions in Monster Truck Trials

When a coin is collected initially we initially had a simple fade out.  This was to boring.



How would we create an explosion in cocos3d?  One concept would be to create clones of the original object and fire them off in various directions.

As we have the physics engine available, the following process was chosen.

  • Spawn 10 new copies of the current one.
  • Create a collision mask so that only explosion object can influence each other.
  • Randomly change thier direction.
  • Apply a little impulse.
  • Create a fade out event that on completion removes the objects from the 3d and physics worlds.
The impulse alone would not be enough to make the objects go all over the place but as they are being spawned in the same locations the physics engine will make them react with each other as long as they have the same collision mask.

And here is the code.

float previous = node.rotation.y;
    for (int x = 0; x < 10; x++) {
    
        int random = [Helper getRandomNumberBetweenMin:1 andMax:10];
        CC3MeshNode* newCoin = [node copyAutoreleased];
        newCoin.uniformScale = 0.05 * random;
        newCoin.location = node.location;
        newCoin.quaternion = node.quaternion;
   
        [_activeWorld addChild:newCoin];
        [newCoin rotateBy:cc3v( previous + (80 * random), previous + (80 *  random), previous + (20 * random))];
        previous = newCoin.rotation.y;
        CC3PhysicsObject3D* explosionObject = [_physicsWorld createMyPhysicsObject:newCoin shape:boxShape2 mass:100 restitution:0.1 position:newCoin.location isStatic: NO : COL_PARTICLE : COL_PARTICLE];
        explosionObject.rigidBody->applyCentralImpulse(btVector3(5,5,0));
        CCFadeOut* fadeOut2 = [CCFadeOut actionWithDuration: random * 0.2];
        CCSequence *seq = [CCSequence actions:fadeOut2,   [CCCallFuncN actionWithTarget:explosionObject selector:@selector(remove)], nil];
        [explosionObject.node runAction:seq];    
       
    }    


I hope its of some use.


Duncan.




Sunday, 29 July 2012

Monster Truck Trials - IPhone / Ipad Game - Adobe Premier - Preview

So apparently it is a good idea to do some pre-launch media, well how do you do that?
One first step in the right direction would be to get a video trailer together.



I have created the following trailer for my new game "Monster Truck Trials" (Working title)

I used a program called reflection to record the in game scenes from my IPad.
I created some basic rendered graphics using blender.
Then using adobe premier I pinned it all together.

I'm not a music composer but it is important to make sure that any music you use is licensed, this is the same for any external media you use in your production.
I have found that http://luckylionstudios.com provide some great backing tracks!