Monday, December 3, 2012

kxCube->Fracture (n);

    I've been busy working on kyuplex.  But my friend came over last week and asked to try another level of my game.  I had nothing for him because all my work has been on the back end!
   I created a base kxCube class that will be the foundation of most game entities, including kxPlayerCube, kxTargetCubes, kxEnvStaticCubes, kxEnvDynamicCubes, etc.  I hope to have it serve as the foundation class for some voxel like algorithms.
   I've implemented one method in the kxCube class: Fracture (n)  where n=number of side sub-divisions and n^3 would be the total number of created sub-cubes.  The image above is the result of player death with Fracture (4).  I tested only up to 6, where frame rates dropped dramatically because every single cube created has it's own scene node and dynamics world rigid body.  Needs optimizing for sure.
   But now the playerCube class holds all initialization and management of it's own scene node and physics bodies and is no longer polluting my primary game class scope.  Now I can start deriving other kinds of cubes such as target cubes!


No comments:

Post a Comment