Beispiel #1
0
// ---
void DragonWindGame::initialize ()
{
	QGAMES::ArcadeGame::initialize ();

	// Sets the icon of the game...
	mainScreen () -> setIcon (formBuilder () -> form (__DRAGONWINDICON__));

	// Add to the world its different world...
	// Initially none of them is active!
	addWorld (__DRAGONSELECTIONWORLD);
	addWorld (__DRAGONTRAININGWORLD);

	// Add to the game its different states...
	addState (new DragonWindPauseState (this), std::string (__DRAGONSTATEPAUSENAME));
	addState (new DragonWindInitialState (this), std::string (__DRAGONSTATEINITIALNAME));
	addState (new DragonWindIntroductionState (this), std::string (__DRAGONSTATEINTRODUCTIONNAME));
	addState (new DragonWindSelectionState (this), std::string (__DRAGONSTATESELECTONNAME));
	addState (new DragonWindInstructionsState (this), std::string (__DRAGONSTATEINSTRUCTIONSNAME));
	addState (new DragonWindTrainingState (this), std::string (__DRAGONSTATETRAININGNAME));
	addState (new DragonWindCountingDownState (this), std::string (__DRAGONSTATECOUNTDOWNNAME));
	addState (new DragonWindPlayingState (this), std::string (__DRAGONSTATEPLAYINGNAME));
	addState (new DragonWindEndState (this), std::string (__DRAGONSTATEENDNAME));
	addState (new DragonWindWinState (this), std::string (__DRAGONSTATEWINNAME));

	// Add to the game its different artists
	// Their visibility will depend on the world and scene the main players are in
	addArtist (_DRAGONNINJAARTIST); // The main character of the game...
	addArtist (_DRAGONNINJAARTISTB); 
	// The other main character of the game...this last one is only used during presentations!

	// The initial state...
	setState (std::string (__DRAGONSTATEINTRODUCTIONNAME));
}
Beispiel #2
0
bool Body::createBody()
{
    if( body ) return true;

    btCollisionShape* bulletShape = getBulletShape();
    if( !bulletShape ) return false;

    motionState = new BodyMotionState( entity->getTransform() );

    btVector3 localInertia;
    localInertia.setZero();

    if( isDynamic() )
        bulletShape->calculateLocalInertia(mass, localInertia);

    btRigidBody::btRigidBodyConstructionInfo info(
        mass, motionState, bulletShape, localInertia);

    body = AllocateThis(btRigidBody, info);

    updateProperties();

    addWorld();

    return true;
}