Esempio n. 1
0
/* Overridden GameAction to ensure that objects use the modified time */
void Demo3Main::GameAction()
{
	// If too early to act then do nothing
	if ( !IsTimeToAct() ) // No sleep, will just keep polling constantly - this is a difference from the base class
		return;

	// Don't act for another 1 tick - this is a difference from the base class
	SetTimeToAct( 1 );

	UpdateAllObjects( GetTime() );
}
/* 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() );
}
/* 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() );
}
Esempio n. 4
0
/* Overridden GameAction which can be modified */
void SimpleDemo::GameAction()
{
	// If too early to act then do nothing
	if ( !IsTimeToActWithSleep() )
		return;

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

	// Tell all objects to update themselves
	UpdateAllObjects( GetTime() );
}
Esempio n. 5
0
/* 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() );
}
Esempio n. 6
0
/* 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;
	}
}
Esempio n. 7
0
	void Scene::Update()
	{
		UpdateAllObjects();
	}