Example #1
0
 // initialise score board
 /// <summary>
 /// Initialise a score board
 /// </summary>
 /// <returns></returns>
 public static LivesBoard GetInstance(IAmMediator med)
 {
     if (_firstInstance == null)
     {
         _firstInstance = new LivesBoard(med);
     }
     return(_firstInstance);
 }
Example #2
0
 // initialise an enemy pool
 /// <summary>
 /// Initialise an enemy pool
 /// </summary>
 /// <param name="mediator"></param>
 /// <param name="level"></param>
 /// <returns></returns>
 public static EnemyPool GetInstance(int level, IAmMediator mediator)
 {
     if (_firstInstance == null)
     {
         _firstInstance = new EnemyPool(level, mediator);
     }
     return(_firstInstance);
 }
Example #3
0
 public GameObject(string[] id, int hp, double x, double y, IAmMediator mediator)
 {
     _id = id;
     _x  = x;
     _y  = y;
     _hp = hp;
     if (!(AreYou("tank") || AreYou("bullet")))
     {
         _objBM = new Bitmap(SpecificObj, SpecificObj + ".png");
     }
     _mapMediator = mediator;
 }
Example #4
0
 // "create" an item
 /// <summary>
 /// Create a new item from the item factory
 /// </summary>
 /// <param name="selector"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="mediator"></param>
 /// <returns></returns>
 public Item MakeItem(int selector, double x, double y, IAmMediator med)
 {
     if (selector.Equals(null))
     {
         return(null);
     }
     if (selector == 0)
     {
         return(new ExplodeAll(x, y, med));
     }
     else if (selector >= 1)
     {
         return(new RainBullet(x, y, med));
     }
     return(null);
 }
Example #5
0
 public ExplodeAll(double x, double y, IAmMediator med) : base(new string[] { "item", "explodeAll" }, x, y, med)
 {
     Hp = 10;
 }
Example #6
0
 public Wall(string[] id, int x, int y, IAmMediator med) : base(id, 0, x, y, med)
 {
     Hp = WallTypeHp(id);
 }
Example #7
0
 private LivesBoard(IAmMediator mediator)
 {
     _mediator = mediator;
 }
Example #8
0
 public RainBullet(double x, double y, IAmMediator med) : base(new string[] { "item", "rainBullet" }, x, y, med)
 {
     Hp = 10;
 }
Example #9
0
 private EnemyPool(int level, IAmMediator mediator)
 {
     UpdateMax(level);
     _mapMediator = mediator;
 }
Example #10
0
 public Item(string[] id, double x, double y, IAmMediator med) : base(id, x, y, med)
 {
 }
Example #11
0
 public Enemy(double x, double y, IAmMediator med) : base(new string[] { "tank", "enemy" }, 50, x, y, med)
 {
     // move up by default
     _movableDirection = new List <double[]>();
     _movableDirection.Add(new double[] { 0, _speed });
 }
Example #12
0
 public Tank(string[] id, int hp, double x, double y, IAmMediator med) : base(id, hp, x, y, med)
 {
 }
Example #13
0
 public Player(IAmMediator med) : base(new string[] { "tank", "player" }, 100, 60, 780, med)
 {
     _lives = 3;
     _score = 0;
     med.AddObject(this);
 }
Example #14
0
 public Bullet(double x, double y, char orientation, IAmMediator med) : base(new string[] { "weapon", "bullet" }, x, y, med)
 {
     Damage       = 10;
     _orientation = orientation;
 }
Example #15
0
 public Fort(IAmMediator med) : base(new string[] { "fort", "fort" }, 10, 480, 780, med)
 {
     med.AddObject(this);
 }