Exemplo n.º 1
0
 public override void Collide(BusinessLogic i, double ms)
 {
     if(i is EnemyBl)
     {
         OnEnemyShot((i as EnemyBl).Etype.Points);
         OnRemove();
     }
 }
Exemplo n.º 2
0
 public override void Collide(BusinessLogic i, double ms)
 {
     if(i is PlayerBl)
     {
         (shape as PowerUPModel).Powerup(i as PlayerBl);
     }
     OnRemove();
 }
Exemplo n.º 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();
     }
 }
Exemplo n.º 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();
         }
     }
 }
Exemplo n.º 5
0
 public void RemoveFromEntities(BusinessLogic bl)
 {
     entities.Remove(bl);
     OnRemoveObject(bl);
 }
Exemplo n.º 6
0
 public void OnRemoveObject(BusinessLogic bl)
 {
     EventHandler<BusinessLogic> h = RemoveObject;
     if (h != null) h(this, bl);
 }
Exemplo n.º 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);
 }
Exemplo n.º 8
0
 public abstract void Collide(BusinessLogic i, double ms);
Exemplo n.º 9
0
 public void OnNewEntity(BusinessLogic b)
 {
     EventHandler<BusinessLogic> handler = NewEntity;
     if (handler != null) handler(this, b);
 }
Exemplo n.º 10
0
 public void RemoveFromScene(BusinessLogic bl)
 {
     if (BL_Shape_Dict.ContainsKey(bl))
     {
         items.Remove(BL_Shape_Dict[bl]);
         BL_Shape_Dict.Remove(bl);
     }
 }
Exemplo n.º 11
0
 public void AddToScene(BusinessLogic s)
 {
     GameObjectShape shape = new GameObjectShape(s.Shape);
     items.Add(shape);
     BL_Shape_Dict.Add(s, shape);
 }
Exemplo n.º 12
0
 public override void Collide(BusinessLogic i, double ms)
 {
     OnRemove();
 }