Exemple #1
0
        public override void ThrowUpdate()
        {
            KeyboardState keyState = Keyboard.GetState();

            hasBeenUnpressed |= !keyState.IsKeyDown(activationKey);

            throwTime += Time.deltaTime;
            if (throwTime > maxThrowTime)
            {
                velocity *= .75f;
                FadeAway();
            }

            if (keyState.IsKeyDown(activationKey))
            {
                Explode(collider.Center());
            }

            blob.transform.Translate(velocity * Time.deltaTime);
            List <Enemy> enemies = EnemyManager.Instance.GetEnemies();

            for (int i = 0; i < enemies.Count; i++)
            {
                if (enemies[i].blob.Collides(this.blob))
                {
                    Explode(collider.Center());
                    Shake.ShakeIt(10, 20);
                    BlobManager.Instance.PauseForDuration(0.10f);
                    break;
                }
            }
        }
Exemple #2
0
 public override void EndPunch()
 {
     if (hasBeenUnpressed)
     {
         Explode(blob.transform.Position);
         Shake.ShakeIt(10, 20);
         BlobManager.Instance.PauseForDuration(0.10f);
     }
 }
Exemple #3
0
        public override void Update()
        {
            base.Update();

            List <Enemy> enemies = EnemyManager.Instance.GetEnemies();

            for (int i = 0; i < enemies.Count; i++)
            {
                if (enemies[i].blob.Collides(this.blob))
                {
                    //hit enemy
                    enemies[i].Hit(this, relativeKnockbackCollider);
                    Shake.ShakeIt(shakeStrength, shakeFrames);
                    BlobManager.Instance.PauseForDuration(stickLength);
                    if (--hits == 0)
                    {
                        blob.Destroy();
                        break;
                    }
                }
            }
        }