Beispiel #1
0
 public override void Collide(BusinessLogic i, double ms)
 {
     if(i is EnemyBl)
     {
         OnEnemyShot((i as EnemyBl).Etype.Points);
         OnRemove();
     }
 }
Beispiel #2
0
 public override void Collide(BusinessLogic i, double ms)
 {
     if(i is PlayerBl)
     {
         (shape as PowerUPModel).Powerup(i as PlayerBl);
     }
     OnRemove();
 }
Beispiel #3
0
 public override void Collide(BusinessLogic i, double ms)
 {
     if ((i is EnemyBl || i is EnemyBulletBl) && (ms-lastcollision > collisionInterval))
     {
         lastcollision = ms;
         Lives--;
         this.shape.SetXY(481 / 2, 600);
         if (Lives == 0) OnDeath();
     }
 }
Beispiel #4
0
 public override void Collide(BusinessLogic i, double ms)
 {
     if(i is PlayerBulletBl)
     {
         etype.Health -= (i as PlayerBulletBl).Damage;
         if (etype.Health <= 0)
         {
             OnDeath();
             OnRemove();
         }
     }
 }
Beispiel #5
0
 public void RemoveFromEntities(BusinessLogic bl)
 {
     entities.Remove(bl);
     OnRemoveObject(bl);
 }
Beispiel #6
0
 public void OnRemoveObject(BusinessLogic bl)
 {
     EventHandler<BusinessLogic> h = RemoveObject;
     if (h != null) h(this, bl);
 }
Beispiel #7
0
 public void AddToEntities(BusinessLogic bl)
 {
     entities.Add(bl);
     if (bl is ICanDie) (bl as ICanDie).Death += (x, e) => HandleDeath(x as ICanDie);
     bl.Remove += (k, l) => RemoveFromEntities(k as BusinessLogic);
     OnNewObject(bl);
 }
Beispiel #8
0
 public abstract void Collide(BusinessLogic i, double ms);
Beispiel #9
0
 public void OnNewEntity(BusinessLogic b)
 {
     EventHandler<BusinessLogic> handler = NewEntity;
     if (handler != null) handler(this, b);
 }
Beispiel #10
0
 public void RemoveFromScene(BusinessLogic bl)
 {
     if (BL_Shape_Dict.ContainsKey(bl))
     {
         items.Remove(BL_Shape_Dict[bl]);
         BL_Shape_Dict.Remove(bl);
     }
 }
Beispiel #11
0
 public void AddToScene(BusinessLogic s)
 {
     GameObjectShape shape = new GameObjectShape(s.Shape);
     items.Add(shape);
     BL_Shape_Dict.Add(s, shape);
 }
Beispiel #12
0
 public override void Collide(BusinessLogic i, double ms)
 {
     OnRemove();
 }