/// <summary>
 /// 被跟踪的怪物正在行动
 /// </summary>
 /// <param name="aMonster">怪物</param>
 /// <param name="Vector">速度</param>
 public abstract void Tracking(Monster aMonster, ref PointF Vector);
 //击杀怪物事件处理
 private void OnMonsterKilled(Game aGame, Monster aMonster)
 {
     MonsterBase m = (MonsterBase)aMonster;
     AddMoneyClip(aMonster.Position, m.Money);
     FMoney += m.Money;
     FKilled += 1;
     RefreshCaption();
 }
 //怪物通过事件处理
 private void OnMonsterPass(Game aGame, Monster aMonster)
 {
     FLife--;
     if (FLife == 0)
     {
         FinishGame(false);
         FBornCount = 0;
     }
     RefreshCaption();
 }
Exemple #4
0
 /// <summary>
 /// 创建怪物(地图2)
 /// </summary>
 /// <param name="Channel">出口</param>
 /// <param name="aMonster">怪物</param>
 public void SetMonster2(Monster aMonster)
 {
     aMonster.OriginalDirection = Direction.Right;
     aMonster.Position = new PointF(32, 64);          //初始小怪生成位置
     FMonsters[0].AddLast(aMonster);                 //马克!待会回来看
 }
Exemple #5
0
 /// <summary>
 /// 创建怪物(地图3)
 /// </summary>
 /// <param name="Channel">出口</param>
 /// <param name="aMonster">怪物</param>
 public void SetMonster3(Monster aMonster)
 {
     aMonster.OriginalDirection = Direction.Left;
     aMonster.Position = new PointF(640, 96);          //初始小怪生成位置
     FMonsters[0].AddLast(aMonster);                 //马克!待会回来看
 }
 public override void Tracking(Monster aMonster, ref PointF Vector)
 {
     if (!Updating)
     {
         float Factor = 1;
         switch (Level)
         {
             case 0:
                 Factor = 0.6f;
                 break;
             case 1:
                 Factor = 0.4f;
                 break;
             case 2:
                 Factor = 0.3f;
                 break;
         }
         Vector.X *= Factor;
         Vector.Y *= Factor;
     }
 }
 protected override void Hit(int Level, PointF Pos, Monster m, LinkedList<Monster>[] Monsters)
 {
     m.Hurt((Level + 1) * (Level + 1));
 }
 /// <summary>
 /// 击中处理
 /// </summary>
 /// <param name="Level">等级</param>
 /// <param name="m">被击中怪物</param>
 /// <param name="Monsters">所有怪物</param>
 protected virtual void Hit(int Level, PointF Pos, Monster m, LinkedList<Monster>[] Monsters)
 {
 }
 public override void Tracking(Monster aMonster, ref PointF Vector)
 {
 }
 protected override void Hit(int Level, PointF Pos, Monster m, LinkedList<Monster>[] Monsters)
 {
     RangeClip aClip = new RangeClip(((int)GetRange(Level)) / 10, GetRange(Level) / 2, Pos);
     FRanges.AddLast(aClip);
     FGame.AddClip(aClip);
 }