Beispiel #1
0
//izvaja operacije ki so dolocene za izbrani testniProgram definiran v test_mng.c
void izvediOperacije(){
  //na ekran izrise loading bar in izpise trenutno operacijo
  drawLoadingBar();  
  
  //ce operacije vrne 1 se bo program premaknil naprej na naslednjo operacijo
  int naprej = 0;
  
  switch (operacijeState){
  case PREVERI_PINE:
    naprej = preveriPine();
    break;
    
  case PREVERI_FLASH:
    naprej = operacijaFlash();
    break;
    
  case PREVERI_LEDICE:
    naprej = preveriLedice();
    break;
    
  case PREVERI_TIPKE:
    naprej = preveriTipke();
    break;
    
  case PREVERI_BACKLIGHT:
    naprej = preveri_backlight();
    break;
    
  case PREVERI_FLASH_OFF:
    naprej = operacijaFlashOff();
    break;
    
  case ZAKLJUCI:
    izpisiSporocilo("TEST" "\n" "KONCAN", "odstranite napravo", 10);
    kontrolaStanja = CAKAJ_RESET;
    break;
  }
  
  //postavi nasljednjo operacijo    
  if(naprej){
    drawOperationOK();//preden nastavi novo stanje se izpise operacijo
    operacijeState = getNextOperation();
    initOperation();
  }
  
}
Beispiel #2
0
void hlct::Game::draw(){
    ofRectangle stageRect(stagePos.get(), stageWidth.get(), stageHeight.get());
    background.draw(stageRect);
    
    switch (state){
        case GAME_STATE_TITLE:
            screens["title"].draw();
            break;
        case GAME_STATE_POSING: {
            screens["posing"].draw();
            if (bUserExists && bUserPosing){
                ofSetColor(ofColor::white);
                drawLoadingBar(loadingBarRect, gameStartTimer.getCurrentValue());
                if (gameStartTimer.getCurrentValue() == 1.f && !gameStartTimer.isAnimating()){
                    startGame();
                }
            }
            break;
        }
        case GAME_STATE_GAME: {
            ofSetColor(ofColor::white);
            hero.draw(bDebug);
            for (auto h : winHelmets){
                h->draw(bDebug);
            }
            for (auto h : helmets){
                h->draw(bDebug);
            }
            if (bDebug){
                ofPushStyle();
                ofNoFill();
                ofSetColor(ofColor::purple);
                ofDrawRectangle(stagePos.get().x + dropX, stagePos.get().y, dropWidth, stageHeight);
                ofPopStyle();
            }
            livesDisplay.draw(stageRect, livesLeft, scaleLive);
            break;
        }
        case GAME_STATE_END_LOOSE:
            screens["loose"].draw();
            break;
        case GAME_STATE_END_WIN:
            screens["win"].draw();
            break;
        default:
            break;
    }
    
    // Draw end timer bar
    if (state == GAME_STATE_END_LOOSE || state == GAME_STATE_END_WIN){
        ofSetColor(ofColor::white, 100);
        drawLoadingBar(loadingBarRect, gameEndTimer.getCurrentValue());
        ofSetColor(ofColor::white);
    }
    
    if (bDebug) {
        ofPushStyle();
        ofSetColor(ofColor::greenYellow);
        ofNoFill();
        ofDrawRectangle(stageRect);
        ofPopStyle();
    }
}