示例#1
0
 public void Add(AeroObject item)
 {
     //if (!Level.Boss.Alive)
     if(!GamePlayScreen.levels[GamePlayScreen.level - 1].Boss.Alive)
     {
         if (item is Cruiser)
         {
             runningScore += 20;
             totalScore += 20;
         }
         else if (item is Fighter)
         {
             runningScore += 40;
             totalScore += 40;
         }
         else if (item is Kamacazie)
         {
             runningScore += 60;
             totalScore += 60;
         }
         else if (item is ArmyBoss)
         {
             runningScore += 500;
             totalScore += 500;
         }
         else if (item is KamacazieBoss)
         {
             runningScore += 500;
             totalScore += 500;
         }
         else if (item is TwinBoss)
         {
             runningScore += 700;
             totalScore += 700;
         }
         else if (item is ArtilleryBoss)
         {
             runningScore += 700;
             totalScore += 700;
         }
         else if (item is ShadowBoss)
         {
             runningScore += 1000;
             totalScore += 1000;
         }
         scoreString = "Score: " + runningScore.ToString();
     }
 }
示例#2
0
 public void MoveFromMissile(AeroObject missile, TimeSpan elapsedTime)
 {
     if (MathHelper.Distance(center.Y, missile.BoundingRectangle.Center.Y) < speed * (float)elapsedTime.TotalSeconds)
         //position.Y = missile.BoundingRectangle.Center.Y;
     //else
     {
         if (missile.BoundingRectangle.Center.Y < center.Y)
             position.Y += speed * (float)elapsedTime.TotalSeconds;
         else
             position.Y -= speed * (float)elapsedTime.TotalSeconds;
     }
     if (MathHelper.Distance(position.X, missile.BoundingRectangle.Center.X) < speed * (float)elapsedTime.TotalSeconds)
         //center.X = missile.BoundingRectangle.Center.X;
     //else
     {
         if (missile.BoundingRectangle.Center.X < center.X)
             position.X += speed * (float)elapsedTime.TotalSeconds;
         else
             position.X -= speed * (float)elapsedTime.TotalSeconds;
     }
 }
示例#3
0
文件: Level.cs 项目: JustinLogic/Aero
 protected static bool CollisionCheckWithPlayer(AeroObject object2)
 {
     if (Player.BoundingRectangle.Intersects(object2.BoundingRectangle))
         if (IntersectPixels(Player.Rotation, Player.Texture.Width, Player.Texture.Height, Player.TextureData,
             object2.Rotation, object2.Texture.Width, object2.Texture.Height, object2.TextureData))
             return true;
     return false;
 }
示例#4
0
 private void GetNewTarget()
 {
     float bestDistance = 2000;
     float newDistance;
     for (int i = 0; i < Level.activeObjects.Count; i++)
     {
         if (Level.activeObjects[i].Friendly == !friendly && Level.activeObjects[i].Alive == true
             && (Level.activeObjects[i] is Enemy || Level.activeObjects[i] is Boss))
         {
             newDistance = Vector2.Distance(position, Level.activeObjects[i].Position);
             if (newDistance < bestDistance)
             {
                 bestDistance = newDistance;
                 target = Level.activeObjects[i];
             }
         }
     }
 }
示例#5
0
 public void Spawn(Vector2 center, float firingAngle, AeroObject target)
 {
     position.X = center.X + texture.Width / 2;
     position.Y = center.Y + texture.Height / 2;
     theta = firingAngle;
     this.target = target;
     alive = true;
     SetRotation();
     Level.activeObjects.Add(this);
 }