コード例 #1
0
/* Overridden GameAction to ensure that objects use the modified time */
void BouncingBallMain::GameAction()
{
	// If too early to act then do nothing
	if ( !TimeToAct() )
		return;

	// Don't act for another 10 ticks
	SetTimeToAct( 1 );

	UpdateAllObjects( GetTime() );
}
コード例 #2
0
/* Overridden GameAction which can be modified */
void MyProjectMain::GameAction()
{
	// If too early to act then do nothing
	if ( !TimeToAct() )
		return;

	// Don't act for another 10 ticks
	SetTimeToAct( 1 );

	// Tell all objects to update themselves
	UpdateAllObjects( GetTime() );
}
コード例 #3
0
ファイル: BaseEngine.cpp プロジェクト: ryan-shaw/G52CPP
/* Sub-class should actually do something, if relevant
e.g. move the player or any other sprites */
void BaseEngine::GameAction()
{
	// If too early to act then do nothing
	if ( !TimeToAct() )
		return;

	// Don't act for another 10 ticks
	SetTimeToAct( 10 );

	// Tell all objects to update themselves.
	// If they need the screen to redraw then they should say so, so that GameRender() will
	// call the relevant function later.
	UpdateAllObjects( GetTime() );
}
コード例 #4
0
ファイル: Demo4Main.cpp プロジェクト: ikanyu/Jumping-Game
/* Overridden GameAction to ensure that objects use the modified time */
void Demo4Main::GameAction()
{
	// If too early to act then do nothing
	if ( !TimeToAct() )
		return;

	// Don't act for another 10 ticks
	SetTimeToAct( 1 );

	// NEW SWITCH
	switch( m_state )
	{
	case stateInit:
	case statePaused:
		break;
	case stateMain:
		// Only tell objects to move when not paused etc
		UpdateAllObjects( GetTime() );
		break;
	}
}