コード例 #1
0
ファイル: Level.cs プロジェクト: bobrathgeber/Whiteout
        internal void LaunchSnowball(Player thrower)
        {
            bool aCreateNew = true;
            foreach (Snowball snowball in _snowballs)
            {
                if (false)//snowball.Alive == false)
                {
                    aCreateNew = false;
                    snowball.Launch(new Vector2(thrower.Position.X + thrower.Width, thrower.Position.Y), thrower.GetThrowVelocity(), thrower.IsDucking(), thrower);
                    thrower.ReleaseSnowball();
                    break;
                }
            }

            if (aCreateNew == true)
            {
                Snowball aSnowball = new Snowball(_content);
                aSnowball.Launch(new Vector2(thrower.Position.X + thrower.Width, thrower.Position.Y), thrower.GetThrowVelocity(), !thrower.IsDucking(), thrower);
                _snowballs.Add(aSnowball);
            }

            thrower.ReleaseSnowball();
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: bobrathgeber/Whiteout
 public void TakeDamage(Snowball snowball)
 {
     Health -= snowball.Damage;
     snowball.Alive = false;
     if (Health <= 0)
     {
         Alive = false;
         animationPlayer.PlayAnimation(animation, "PlayerForwardAttack", 0.3f, true);
     }
 }