Ejemplo n.º 1
0
    // 2.00 Aktivierung
    public static void GoToIntro()
    {
        state = STATE.INTRO;
        UDPSender.SendUDPStringUTF8(ip, port, "state=activation;action=open;");

        if (ParagliderGame.GetInstance().state != ParagliderGame.STATE.RESETTING &&
            ParagliderGame.GetInstance().state != ParagliderGame.STATE.READY)
        {
            ParagliderGame.GetInstance().gameReset();
        }
    }
Ejemplo n.º 2
0
    // 8.0 Unfall / Game Over
    // 9.0 Zeit abgelaufen
    public static void GameOver(bool isTimeout)
    {
        if (state != STATE.GAMEOVER)
        {
            state = STATE.GAMEOVER;
            string action = "crash";
            if (isTimeout)
            {
                action = "timeout";
            }

            UDPSender.SendUDPStringUTF8(ip, port, "state=gameover;action=" + action);
        }
    }
Ejemplo n.º 3
0
 // 2.00 Aktivierung
 public static void ToogleLanguage()
 {
     if (TextProvider.lang == "en")
     {
         TextProvider.lang = "de";
     }
     else
     {
         TextProvider.lang = "en";
     }
     Debug.Log("Language: " + TextProvider.lang);
     UDPSender.SendUDPStringUTF8(ip, port, "state=intro;action=ripcord;value=" + TextProvider.lang);
     ParagliderGame.GetInstance().updateHudTexts();
 }
Ejemplo n.º 4
0
 ///
 /// See 180524_exp_ie_0404_fsb_paraglider_animkom_jn.pdf
 ///
 // 1.00 Standby Modus
 public static void StartStandbymodus()
 {
     state = STATE.STANDBYMODUS;
     UDPSender.SendUDPStringUTF8(ip, port, "state=standbymodus");
     timeUntilStandby = maxTimeUntilStandby;
     if (ParagliderGame.GetInstance() != null)
     {
         if (ParagliderGame.GetInstance().state != ParagliderGame.STATE.RESETTING &&
             ParagliderGame.GetInstance().state != ParagliderGame.STATE.READY)
         {
             ParagliderGame.GetInstance().gameReset();
         }
     }
 }
Ejemplo n.º 5
0
    IEnumerator WaitForGameReady()
    {
        Debug.Log("WaitForGameReady");
        if (ParagliderGame.GetInstance().state != ParagliderGame.STATE.RESETTING &&
            ParagliderGame.GetInstance().state != ParagliderGame.STATE.READY)
        {
            ParagliderGame.GetInstance().gameReset();
        }

        //Todo: start game and turn on character control to be able to play
        while (ParagliderGame.GetInstance().state != ParagliderGame.STATE.READY)
        {
            Debug.Log("Waiting For GameReady");

            yield return(new WaitForSeconds(0.1f));
        }

        UDPSender.SendUDPStringUTF8(ip, port, "state=game;action=start;");
        ParagliderGame.GetInstance().gameStart();
    }
Ejemplo n.º 6
0
 public static void CallChangedGrips(string currentDirections)
 {
     if (state == STATE.INTRO)
     {
         Debug.Log("" + currentDirections);
         UDPSender.SendUDPStringUTF8(ip, port, "state=intro;action=steps;" + currentDirections);
     }
     else if (state == STATE.STARTGAME && currentDirections == "left=down;right=down")
     {
         StartGame();
     }
     else if (state == STATE.GAME && ParagliderGame.GetInstance().state == ParagliderGame.STATE.ATSTART && currentDirections == "left=down;right=down")
     {
         StartPlaying();
     }
     else if ((state == STATE.ABORT || state == STATE.INACTIVITY) && currentDirections == "left=down;right=down")
     {
         ResumeGame();
     }
 }
Ejemplo n.º 7
0
    /// <summary>
    ///
    /// > 3.00: ID = 1
    /// > 4.00: ID = 2
    /// > 4.01: ID = 0
    /// > 4.02: ID = 0
    /// > 5.00: ID = 0
    /// > 6.00: ID = 4
    /// > 7.00: ID = 0
    /// > 8.00 Unfall / Game Over ID = 5
    /// > 9.00 Zeit abgelaufen ID = 5;
    /// </summary>
    /// <param name="_id"></param>
    public static void ChangePromptTextInIGP(int _id)
    {
        string actionString = "";

        switch (_id)
        {
        case 0:
            actionString = "hideheadline";
            break;

        case 1:
            actionString = "gamestart";
            break;

        case 2:
            actionString = "control";
            break;

        case 3:
            actionString = "obstacle";
            break;

        case 4:
            actionString = "finish";
            break;

        case 5:
            actionString = "gameover";
            break;

        default:
            Debug.LogError("case " + _id + "  is missing");
            break;
        }

        UDPSender.SendUDPStringUTF8(ip, port, "state=game;action=" + actionString);
    }
Ejemplo n.º 8
0
 /// <summary>
 /// 7.0 Spielende, needs current game time for score
 /// </summary>
 /// <param name="scoreTime"></param>
 public static void GoToResult(float scoreTime)
 {
     state = STATE.RESULT;
     SetScore(scoreTime);
     UDPSender.SendUDPStringUTF8(ip, port, "state=result;action=time;score=" + endtime);
 }