예제 #1
0
파일: Unit.cs 프로젝트: nubington/bill
 public void Die()
 {
     IsDead = true;
     if (this is Unit)
     {
         UnitAnimation a = new UnitAnimation((Unit)this, Width, .5f, true, Unit.Explosion1Textures);
         a.Start();
     }
 }
예제 #2
0
파일: Animation.cs 프로젝트: nubington/bill
        public static void UpdateAll()
        {
            for (int i = 0; i < UnitAnimations.Count; i++)
            {
                UnitAnimation a = UnitAnimations[i];

                a.Update();

                if (!a.IsRunning || (!a.StayAfterDeath && a.Unit.IsDead))
                {
                    UnitAnimations.Remove(a);
                    i--;
                }
            }
        }
예제 #3
0
파일: Unit.cs 프로젝트: nubington/bill
 public void Die()
 {
     IsDead = true;
     if (this is Unit)
     {
         UnitAnimation a = new UnitAnimation((Unit)this, Width, .5f, true, Unit.Explosion1Textures);
         a.Start();
     }
 }
예제 #4
0
파일: Rts.cs 프로젝트: nubington/bill
        void giveAttackCommand(Vector2 mousePosition)
        {
            foreach (Unit unit in Unit.Units)
            {
                if (unit.Contains(mousePosition))
                {
                    UnitAnimation a = new UnitAnimation(unit, unit.Width, .75f, 8, false, redCircleTexture, transparentTexture);
                    a.Start();

                    foreach (Unit u in SelectedUnits)
                    {
                        if (u != unit)
                        {
                            if (keyboardState.IsKeyUp(Keys.LeftShift))
                            {
                                AttackCommand command = new AttackCommand(unit);
                                u.GiveCommand(command);
                                Unit.PathFinder.AddPathFindRequest(u, command, u.CurrentPathNode, false);
                                //u.GiveCommand(new AttackCommand(unit));
                            }
                            else
                                u.QueueCommand(new AttackCommand(unit));
                        }
                    }
                    return;
                }
            }

            giveMoveCommand(mousePosition);
        }