Changeset 3628


Ignore:
Timestamp:
2012-07-06 02:53:32 (11 years ago)
Author:
dezhidki
Message:

More sounds added

Location:
2012/27/DenisZ/TheDungeonGame
Files:
9 added
4 edited

Legend:

Unmodified
Added
Removed
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/EntityTemplates.cs

    r3624 r3628  
    1313            : base(game, pos, size, shape) 
    1414        { 
     15            health = 2; 
    1516            damage = 1; 
    1617            FollowerBrain brains = new FollowerBrain(game.Player, 100); 
     
    3031        } 
    3132 
     33        public override bool hit(int damage) 
     34        { 
     35            TheDungeonGame.soundEffects[2].Play(); 
     36            return base.hit(damage); 
     37        } 
     38 
    3239        public override void init() 
    3340        { 
     
    4249            : base(game, pos, size, shape) 
    4350        { 
     51            health = 3; 
    4452            damage = 2; 
    4553            Color = Color.Red; 
     
    5967            Animation.Start(); 
    6068        } 
     69 
     70        public override bool hit(int damage) 
     71        { 
     72            TheDungeonGame.soundEffects[3].Play(); 
     73            return base.hit(damage); 
     74        } 
    6175    } 
    6276 
     
    6680            : base(game, pos, size, shape) 
    6781        { 
     82            health = 2; 
    6883            damage = 2; 
    6984            Color = Color.Green; 
     
    8499            Animation.Start(); 
    85100        } 
     101 
     102        public override bool hit(int damage) 
     103        { 
     104            TheDungeonGame.soundEffects[3].Play(); 
     105            return base.hit(damage); 
     106        } 
    86107    } 
    87108 
     
    91112            : base(game, pos, size, shape) 
    92113        { 
     114            health = 1; 
    93115            damage = 1; 
    94116            Color = Color.Blue; 
     
    109131            Animation.Start(); 
    110132            CanRotate = false; 
     133        } 
     134 
     135        public override bool hit(int damage) 
     136        { 
     137            TheDungeonGame.soundEffects[2].Play(); 
     138            return base.hit(damage); 
    111139        } 
    112140    } 
     
    129157 
    130158        private Animation normalWalkingAnimation, powerupWalkingAnimation; 
     159 
     160        private SoundEffect attackSound = TheDungeonGame.LoadSoundEffect("sound/mario/mario_attack"); 
     161        private SoundEffect hitSound = TheDungeonGame.LoadSoundEffect("sound/mario/mario_hit"); 
     162        private SoundEffect upgradeSound = TheDungeonGame.LoadSoundEffect("sound/mario/mario_upgrade"); 
    131163 
    132164        public EntityBossMario(TheDungeonGame game, Vector pos, Vector size, Shape shape) 
     
    167199 
    168200            Brain = randomBrain; 
    169             Brain.Active = true; 
     201            Brain.Active = false; 
    170202            CanRotate = false; 
    171203            Animation = normalWalkingAnimation; 
    172204            Animation.Start(); 
    173             brainTimer.Start(); 
     205             
    174206            Collided += collided; 
    175207        } 
     
    185217        public override bool hit(int damage) 
    186218        { 
     219            hitSound.Play(); 
    187220            if (health <= 35 && !isPowerUpped) 
    188221                upgradeMario(); 
     
    193226        private void upgradeMario() 
    194227        { 
    195             Console.WriteLine("Upgrading..."); 
    196228            if (isPowerUpped) return; 
    197229 
    198             damage = 2; 
     230            upgradeSound.Play(); 
     231            damage = 1; 
    199232            isPowerUpped = true; 
    200233            Animation = powerupWalkingAnimation; 
     
    204237            randomMoveTimer.Timeout += perfomAttack2; 
    205238            followingSpeed = 220; 
    206             randomSpeed = 1500; 
     239            randomSpeed = 15000; 
     240        } 
     241 
     242        public void enableMovement() 
     243        { 
     244            brainTimer.Start(); 
    207245        } 
    208246 
     
    289327            if (usedTurtles) return; 
    290328 
     329            attackSound.Play(); 
    291330            int turtleAmount = amount; 
    292331            for (int i = 0; i < turtleAmount; i++) 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/Player.cs

    r3624 r3628  
    4040        private bool isAnimationRunning = false; 
    4141 
    42         public Player(TheDungeonGame game, Vector pos, Image texture) 
     42        private SoundEffect hitSound = TheDungeonGame.LoadSoundEffect("sound/robot_hit"); 
     43 
     44        public Player(TheDungeonGame game, Vector pos) 
    4345            : base(playerWidth, playerHeight) 
    4446        { 
     
    4850            CanRotate = false; 
    4951            setupKeys(); 
    50             idleTexture = texture; 
     52            idleTexture = TheDungeonGame.LoadImage("animations/player/idle"); 
    5153            Image = idleTexture; 
    5254            for (int i = 0; i < walkingImages.Length; i++) 
     
    123125        { 
    124126            playerHealth.Value -= damage; 
     127            hitSound.Play(); 
    125128            if (playerHealth.Value <= 0) 
    126129            { 
    127130                showLostScreen(); 
    128             } 
    129                  
     131            }          
    130132        } 
    131133 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/TheDungeonGame.cs

    r3624 r3628  
    2727    private bool moveCamera = false; 
    2828 
    29     public Image playerPic = LoadImage("player"); 
    3029    public List<Image> levelTopBottoms = new List<Image>(); 
    3130    public List<Image> levelLeftRights = new List<Image>(); 
     
    6160        soundPlayer = MediaPlayer; 
    6261 
    63         player = new Player(this, Vector.Zero, playerPic); 
     62        player = new Player(this, Vector.Zero); 
    6463        player.setupWeapon(); 
    6564 
     
    8483        soundEffects.Add(LoadSoundEffect("sound/door_close")); 
    8584        soundEffects.Add(LoadSoundEffect("sound/door_open")); 
     85        soundEffects.Add(LoadSoundEffect("sound/bug_hit")); 
     86        soundEffects.Add(LoadSoundEffect("sound/zombie_hit")); 
    8687    } 
    8788 
     
    157158                EntityBossMario mario = (EntityBossMario)player.currentRoom.getEntityAt(3, 3); 
    158159                gui.setupBossGauge(mario); 
     160                mario.enableMovement(); 
    159161            } 
    160162        } 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGameContent/TheDungeonGameContent.contentproj

    r3624 r3628  
    7070      <Processor>TextureProcessor</Processor> 
    7171    </Compile> 
    72     <Compile Include="player.png"> 
    73       <Name>player</Name> 
    74       <Importer>TextureImporter</Importer> 
    75       <Processor>TextureProcessor</Processor> 
    76     </Compile> 
    7772  </ItemGroup> 
    7873  <ItemGroup> 
     
    258253      <Importer>TextureImporter</Importer> 
    259254      <Processor>TextureProcessor</Processor> 
     255    </Compile> 
     256  </ItemGroup> 
     257  <ItemGroup> 
     258    <Compile Include="sound\robot_hit.wav"> 
     259      <Name>robot_hit</Name> 
     260      <Importer>WavImporter</Importer> 
     261      <Processor>SoundEffectProcessor</Processor> 
     262    </Compile> 
     263  </ItemGroup> 
     264  <ItemGroup> 
     265    <Compile Include="sound\bug_hit.wav"> 
     266      <Name>bug_hit</Name> 
     267      <Importer>WavImporter</Importer> 
     268      <Processor>SoundEffectProcessor</Processor> 
     269    </Compile> 
     270    <Compile Include="sound\zombie_hit.wav"> 
     271      <Name>zombie_hit</Name> 
     272      <Importer>WavImporter</Importer> 
     273      <Processor>SoundEffectProcessor</Processor> 
     274    </Compile> 
     275  </ItemGroup> 
     276  <ItemGroup> 
     277    <Compile Include="sound\mario\mario_attack.wav"> 
     278      <Name>mario_attack</Name> 
     279      <Importer>WavImporter</Importer> 
     280      <Processor>SoundEffectProcessor</Processor> 
     281    </Compile> 
     282    <Compile Include="sound\mario\mario_hit.wav"> 
     283      <Name>mario_hit</Name> 
     284      <Importer>WavImporter</Importer> 
     285      <Processor>SoundEffectProcessor</Processor> 
     286    </Compile> 
     287    <Compile Include="sound\mario\mario_upgrade.wav"> 
     288      <Name>mario_upgrade</Name> 
     289      <Importer>WavImporter</Importer> 
     290      <Processor>SoundEffectProcessor</Processor> 
    260291    </Compile> 
    261292  </ItemGroup> 
Note: See TracChangeset for help on using the changeset viewer.