Esempio 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;
     }
 }
Esempio 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
        }
Esempio n. 3
0
 public BonusSpeed(Map map, int x, int y, string textureFile)
     : base(map, x, y, textureFile) { }
Esempio n. 4
0
 public SimpleCreature(Map map, int x, int y, string textureFile)
     : base(map, x, y, textureFile) { }
Esempio n. 5
0
 public Stone(Map map, int x, int y, string textureFile) : base(map, x, y, textureFile) { }
Esempio 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;
 }
Esempio 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);
 }
Esempio 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;
 }
Esempio n. 9
0
 public DestroyableObject(Map map, string textureFile) : base(map, textureFile) { }
Esempio n. 10
0
 public Bomb(Map map, Player owner, int x, int y, string textureFile)
     : base(map, x, y, textureFile)
 {
     this.owner = owner;
 }
Esempio n. 11
0
 public Bomb(Map map, Player owner, int x, int y)
     : base(map, x, y)
 {
     this.owner = owner;
 }
Esempio 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();
 }
Esempio 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) { }
Esempio n. 14
0
 public DestroyableObject(Map map, int x, int y) : base(map, x, y) { }
Esempio 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;
        }
Esempio 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;
 }
Esempio n. 17
0
 public DestroyableObject(Map map, int x, int y, string textureFile)
     : base(map, x, y, textureFile) { }