Beispiel #1
0
 /// <summary>
 /// Reakcja na znalezienie przez Vandala
 /// Efekt dźwiękowy i zwiększenie liczby dynamitów o 5
 /// </summary>
 /// <param name="map">Mapa obiektów</param>
 public override void OnFound(Map.Map map)
 {
     if (!map.player.AudioSettings.IsMuted)
     {
         SoundEffect.MasterVolume = (float)map.player.AudioSettings.SoundVolume;
         found_soundEffect.Play();
     }
     map.addPlayersDynamites(5);
 }
Beispiel #2
0
        /// <summary>
        /// Upusc dynamit
        /// </summary>
        /// <param name="game_map">mapa obiektow</param>
        /// <param name="gametime">czas gry</param>
        public void LeftDynamite(Map.Map game_map, GameTime gametime)
        {
            int dyn_x = x - 1;
            int dyn_y = y;

            switch (view_direction)
            {
            case Game.direction.right:
                dyn_x = x - 1;
                dyn_y = y;
                break;

            case Game.direction.left:
                dyn_x = x + 1;
                dyn_y = y;
                break;

            case Game.direction.up:
                dyn_x = x;
                dyn_y = y + 1;
                break;

            case Game.direction.down:
                dyn_x = x;
                dyn_y = y - 1;
                break;
            }

            //nie zmieniamy pozycji Vandala (wstawiamy dynamit za Vandalem)
            collision_obj = game_map.getObject(dyn_x, dyn_y);
            if (collision_obj.GetType() == typeof(NonDestroyableObjects.Puste))
            {
                game_map.setObject(dyn_x, dyn_y, new Weapon.Dynamit(content, new Rectangle(dyn_x * this.rectangle.Width, dyn_y * this.rectangle.Height, this.rectangle.Width, this.rectangle.Height), dyn_x, dyn_y, gametime));
                game_map.addPlayersDynamites(-1);
            }
        }