Ejemplo n.º 1
0
 /// <summary>
 /// Create an instance of barrel with a particular bonus hidden inside
 /// </summary>
 /// <param name="map">Map where this component will be placed</param>
 /// <param name="x">X-coordinate of the map position</param>
 /// <param name="y">Y-coordinate of the map position</param>
 /// <param name="textureFile">Path to the file where barrel texture is stored</param>
 /// <param name="type">Type of the bonus hidden inside the barrel</param>
 public Barrel(Map map, int x, int y, string textureFile, BonusType type)
     : this(map, x, y, textureFile)
 {
     //BonusType = type;
     switch (type)
     {
         case BonusType.Bomb: bonus = new BonusBomb(map, MapX, MapY, "Images/bonusBomb1"); break;
         case BonusType.Fire: bonus = new BonusFire(map, MapX, MapY, "Images/bonusFire1"); break;
         case BonusType.Speed: bonus = new BonusSpeed(map, MapX, MapY, "Images/bonusSpeed1"); break;
     }
 }
Ejemplo n.º 2
0
        private void startRound()
        {
            rounds--;
            Map map = new Map(Game, spriteBatch, this, players, "map1.dat");
            map.DrawOrder = 1;

            Rectangle rec = GraphicsDevice.DisplayMode.TitleSafeArea;
            rec.Height -= (int)MapObject.Size * 3;
            map.Area = rec;

            // set panel area each time round is started - size of map could change
            bottomPanel.Area = new Rectangle(rec.X, (int)(map.Height * MapObject.Size),
                (int)(map.Width * MapObject.Size), (int)MapObject.Size);            

            Game.Components.Add(map);
            NextScreen(map);    // switch to map screen
        }
Ejemplo n.º 3
0
 public BonusSpeed(Map map, int x, int y, string textureFile)
     : base(map, x, y, textureFile) { }
Ejemplo n.º 4
0
 public SimpleCreature(Map map, int x, int y, string textureFile)
     : base(map, x, y, textureFile) { }
Ejemplo n.º 5
0
 public Stone(Map map, int x, int y, string textureFile) : base(map, x, y, textureFile) { }
Ejemplo n.º 6
0
 /// <summary>
 /// Base constructor of all map objects
 /// </summary>
 /// <param name="map">Map where this component will be placed</param>
 /// <param name="x">X-coordinate of the map position</param>
 /// <param name="y">Y-coordinate of the map position</param>
 /// <param name="textureFile">Path to the file where texture for this object is stored</param>
 public MapObject(Map map, int x, int y, string textureFile)
     : this(map, textureFile)
 {
     this.map = map;
     this.Position = new Vector2(x * Size, y * Size);
     this.textureFile = textureFile;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Base constructor of all map objects
 /// </summary>
 /// <param name="map">Map where this component will be placed</param>
 /// <param name="x">X-coordinate of the map position</param>
 /// <param name="y">Y-coordinate of the map position</param>
 public MapObject(Map map, int x, int y)
     : this(map)
 {
     this.Position = new Vector2(x * Size, y * Size);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Base constructor of all map objects
 /// </summary>
 /// <param name="map">Map where this component will be placed</param>
 /// <param name="textureFile">Path to the file where texture for this object is stored</param>
 public MapObject(Map map, string textureFile)
     : this(map)
 {
     this.textureFile = textureFile;
 }
Ejemplo n.º 9
0
 public DestroyableObject(Map map, string textureFile) : base(map, textureFile) { }
Ejemplo n.º 10
0
 public Bomb(Map map, Player owner, int x, int y, string textureFile)
     : base(map, x, y, textureFile)
 {
     this.owner = owner;
 }
Ejemplo n.º 11
0
 public Bomb(Map map, Player owner, int x, int y)
     : base(map, x, y)
 {
     this.owner = owner;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Create an instance of particle system
 /// </summary>
 /// <param name="map">Map where this component will be placed</param>
 /// <param name="textureFile">Path to the file where texture for this particle system is stored</param>
 public ParticleSystem(Map map, string textureFile) : base(map, textureFile) 
 {
     particles = new List<ParticleData>();
     generator = new Random();
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Create an instance of barrel without any bonus inside
 /// </summary>
 /// <param name="map">Map where this component will be placed</param>
 /// <param name="x">X-coordinate of the map position</param>
 /// <param name="y">Y-coordinate of the map position</param>
 /// <param name="textureFile">Path to the file where barrel texture is stored</param>
 public Barrel(Map map, int x, int y, string textureFile)
     : base(map, x, y, textureFile) { }
Ejemplo n.º 14
0
 public DestroyableObject(Map map, int x, int y) : base(map, x, y) { }
Ejemplo n.º 15
0
        /// <summary>
        /// This constructor always must be called. Default values of the properties are set here.
        /// </summary>
        /// <param name="map">Map where this component will be placed</param>
        private MapObject(Map map)
        {
            Width = Size;
            Height = Size;
            IsPassable = false;

            this.map = map;
        }
Ejemplo n.º 16
0
 public Player(Map map, int x, int y, string textureFile, int id) : base(map, x, y, textureFile) 
 {
     bombCollection = new Queue<Bomb>(bombsCount);
     Id = id;
 }
Ejemplo n.º 17
0
 public DestroyableObject(Map map, int x, int y, string textureFile)
     : base(map, x, y, textureFile) { }