Showing posts with label Ipad. Show all posts
Showing posts with label Ipad. Show all posts

Thursday, 9 August 2012

JewelBlast3D Puzzle Game - IPhone - IPad - Free Game

Quite some time ago I built a free game called JewelBlast3D

JewelBlast3D Free IPhone Game
You can download it for free at 

http://itunes.apple.com/us/app/jewelblast3d/id507150133?mt=8

I'm quite amazed as it is still regularly getting some downloads on the App store.

It has made me think about the type of games people like on mobile platforms.
When I first had a gameboy quite a few years ago, I used to play for hours on Tetris and when I would go to sleep my dad would pick up the gameboy and play for hours!

I don't think much has changed since the early days people still like a good puzzle game that they can play over and over again.  In the end I would compete with my dad to get the highest score.

At some point I want to have a go at re-writting Jewel Blaster, hopefully I will get the time!

Duncan.


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.