Esempio n. 1
0
    void Start()
    {
        EverythingMoves.MoveSpeed = GameData.DefaultSpeed;
        Score.PlayerScore         = 0;
        Player           = this;
        OtterC           = ComboText.ComboTexts["Otter"];
        EagleC           = ComboText.ComboTexts["Eagle"];
        Ghost.OtterCombo = 0;
        Ghost.EagleCombo = 0;
        rigidBody        = GetComponent <Rigidbody2D>();
        anim             = GetComponent <Animator>();
        t         = GetComponent <Transform>();
        animIndex = anim.GetLayerIndex("Base Layer");

        if (Shards.shards != null)
        {
            Shards.shards.Clear();
        }
        Shards.Generate(200);
        if (AudioManager.manager != null)
        {
            AudioManager.PlayMusic();
        }
        GameData.Paused = true;
        hits            = 0;
        inLevel3        = SceneManager.GetActiveScene().name == "Stage 3";
    }
        private void ReceiveDamage(int power)
        {
            HitPoint -= power;
            if (HitPoint < 0)
            {
                HitPoint = 0;
            }

            DamageTextEffect.Create(gameObject, power);
            gauge.Refresh();

            StageSceneGlobalVariables.Instance.PlayerParty.Combo += 1;
            int combo = StageSceneGlobalVariables.Instance.PlayerParty.Combo;

            if (combo >= 2)
            {
                ComboText.Create(gameObject, combo);
            }

            if (HitPoint == 0)
            {
                gameObject.AddComponent <EnemyDeadEraseEffect>();
                StageSceneGlobalVariables.Instance.Score += DeadScore;                  //スコア加算
            }
        }
Esempio n. 3
0
 void Start()
 {
     WolfV  = Vignette.Vignettes["Wolf"];
     OtterV = Vignette.Vignettes["Otter"];
     EagleV = Vignette.Vignettes["Eagle"];
     OtterC = ComboText.ComboTexts["Otter"];
     EagleC = ComboText.ComboTexts["Eagle"];
     t      = GetComponent <Transform>();
     if (KatanaLayer == -1)
     {
         KatanaLayer = LayerMask.NameToLayer("katana");
     }
 }
Esempio n. 4
0
        public void Draw(SpriteBatch spriteBatch)
        {
            LevelText.Text    = "Lvl " + GlobalData.Session.CurrentLevel;
            ScoreText.Text    = scene.Player.Score.Value.ToString("N0");
            ComboText.Text    = "x" + scene.Player.CurrentCombo.ToString();
            MaxComboText.Text = "x" + scene.Player.HighestCombo.ToString();

            int levelLength         = (int)TitleFont.MeasureString(LevelText.Text).X + margin;
            int comboLength         = (int)TitleFont.MeasureString(ComboText.Text).X + margin;
            int maxComboLength      = (int)TitleFont.MeasureString(MaxComboText.Text).X + margin;
            int maxComboVerticalPos = TitleFont.LineSpacing + margin;

            Rectangle leftSourceRectangle      = new Rectangle(0, 0, background.Width, background.Height);
            Rectangle leftDestinationRectangle = new Rectangle(0, 0, levelLength, background.Height);

            Rectangle rightSourceRectangle = new Rectangle(
                GlobalData.Screen.Width - comboLength, 0,
                background.Width, background.Height);

            Rectangle rightDestinationRectangle = new Rectangle(
                GlobalData.Screen.Width - comboLength, 0,
                comboLength, background.Height);

            Rectangle rightBottomSourceRectangle = new Rectangle(
                GlobalData.Screen.Width - maxComboLength, maxComboVerticalPos,
                background.Width, background.Height);

            Rectangle rightBottomDestinationRectangle = new Rectangle(
                GlobalData.Screen.Width - maxComboLength, maxComboVerticalPos,
                maxComboLength, background.Height);

            spriteBatch.Draw(background, leftDestinationRectangle, leftSourceRectangle, Color.White);
            spriteBatch.Draw(textures["LeftEdge"], new Vector2(levelLength, 0), Color.White);

            spriteBatch.Draw(background, rightDestinationRectangle, rightSourceRectangle, Color.White);
            spriteBatch.Draw(textures["RightEdge"], new Vector2(GlobalData.Screen.Width - comboLength - textures["RightEdge"].Width, 0), Color.White);

            spriteBatch.Draw(textures["GoldenBackground"], rightBottomDestinationRectangle, rightBottomSourceRectangle, Color.White);
            spriteBatch.Draw(textures["GoldenRightEdge"], new Vector2(GlobalData.Screen.Width - maxComboLength - textures["GoldenRightEdge"].Width, maxComboVerticalPos), Color.White);

            AlignText(LevelText, Alignment.Left);
            AlignText(ScoreText, Alignment.Center);
            AlignText(ComboText, Alignment.Right);
            AlignText(MaxComboText, Alignment.Right, verticalOffset: maxComboVerticalPos);

            LevelText.Draw(spriteBatch);
            ScoreText.Draw(spriteBatch);
            ComboText.Draw(spriteBatch);
            MaxComboText.Draw(spriteBatch);
        }
Esempio n. 5
0
 // Start is called before the first frame update
 void Start()
 {
     comBoText = GetComponent <Text>();
     Instance  = this;
 }
Esempio n. 6
0
 public void SetCombo(int combo)
 {
     ComboText.SetText(combo.ToString());
 }