コード例 #1
0
//--------------------------------------------------------------------------------------------
void Scene::update(float _deltaTime, ofxControlPanel * panel){
    deltaTime = _deltaTime;
    
    activeTimer += deltaTime;
    idleTimer += deltaTime;
    
    checkPanelValues(panel);
    
    field.clear();
    
    //make sure cups and towers match
    if (cupTracker->useCups){
        checkCups();
    }
    
    //have the towers do their thing on the field
    for (int i=towers.size()-1; i>=0; i--){
        towers[i]->update(deltaTime);
    }
    
    //let the scene do what it does
    updateCustom();
    
    //make some field particles so we cna see what the f**k's going on in here!
    makeFieldParticles();
    
    //update the field particles
    //float updateStartTime = ofGetElapsedTimef();
    for (int i=fieldParticles.size()-1; i>=0; i--){
        fieldParticles[i]->update(deltaTime, &field);
        if (fieldParticles[i]->killFlag){
            delete fieldParticles[i];
            fieldParticles.erase( fieldParticles.begin() + i);
        }
    }
    
    
    //time to move on?
    if (activeTimer > killTime ){
        switchScenesFlag = true;
    }
    
    //When switching scenes, the current scene fades out
    //when isDoneFadiing is true, the scene will stop updating
    if (isFading){
        fadeTimer -= deltaTime;
        alphaPrc = fadeTimer/fadeTime;
        
        if (alphaPrc <= 0){
            alphaPrc = 0;
            isDoneFading = true;
        }
    }
}
コード例 #2
0
ファイル: TempoSyncKnobModel.cpp プロジェクト: DomClark/lmms
void TempoSyncKnobModel::setSyncMode( TempoSyncMode _new_mode )
{
	if( m_tempoSyncMode != _new_mode )
	{
		m_tempoSyncMode = _new_mode;
		if( _new_mode == SyncCustom )
		{
			connect( &m_custom, SIGNAL( dataChanged() ),
					this, SLOT( updateCustom() ) );
		}
	}
	calculateTempoSyncTime( Engine::getSong()->getTempo() );
}
コード例 #3
0
void GameObject::update(float _deltaTime){
    deltaTime = _deltaTime;
    
    //do whatever this object does
    updateCustom();
    
    //update the animator if this thing has one
    if (animController != NULL){
        animController->update(deltaTime);
    }
    
    //keep any pixel effects with the object
    for (int i=0; i<pixelEffects.size(); i++){
        pixelEffects[i]->setPosFromParentObject(pos);
    }
    
}