Exemple #1
0
        public static void Init()
        {
            score     = 0;
            highScore = SerializationSystem.GetValue <int>("highScore.json");

            isBirdFly     = false;
            isGameWaiting = true;

            highScoreLabel = new SELabel(SEResourcesManager.GetFontByName("PixelFontScore"));
            highScoreLabel.GetComponent().GetFontComponent().SetText(highScore.ToString());
            highScoreLabel.GetComponent().GetTransformComponent().SetPosition(SEProperties.GetGameWindowWidth() / 2, SEProperties.GetGameWindowHeight() / 8);

            scoreLabel = new SELabel(SEResourcesManager.GetFontByName("PixelFontScore"));
            scoreLabel.GetComponent().GetFontComponent().SetText(score.ToString());
            scoreLabel.GetComponent().GetTransformComponent().SetPosition(SEProperties.GetGameWindowWidth() / 2, SEProperties.GetGameWindowHeight() / 20);

            textLabel = new SELabel(SEResourcesManager.GetFontByName("PixelFontText"));
            textLabel.GetComponent().GetFontComponent().SetText("Tap on space to play game");
            textLabel.GetComponent().GetTransformComponent().SetPosition(150, 400);

            groundHeigth = 450;
        }
Exemple #2
0
 public static void Reload()
 {
     if (SerializationSystem.GetValue <int>("highScore.json") < score)
     {
         SerializationSystem.SaveValue(score);
         highScore = score;
     }
     score         = 0;
     isBirdFly     = false;
     isGameWaiting = true;
     scoreLabel.GetComponent().GetFontComponent().SetText(score.ToString());
     highScoreLabel.GetComponent().GetFontComponent().SetText(highScore.ToString());
     textLabel.GetComponent().GetFontComponent().SetText("Tap on space to play game");
 }