Changeset 3628
- Timestamp:
- 2012-07-06 02:53:32 (11 years ago)
- Location:
- 2012/27/DenisZ/TheDungeonGame
- Files:
-
- 9 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/EntityTemplates.cs
r3624 r3628 13 13 : base(game, pos, size, shape) 14 14 { 15 health = 2; 15 16 damage = 1; 16 17 FollowerBrain brains = new FollowerBrain(game.Player, 100); … … 30 31 } 31 32 33 public override bool hit(int damage) 34 { 35 TheDungeonGame.soundEffects[2].Play(); 36 return base.hit(damage); 37 } 38 32 39 public override void init() 33 40 { … … 42 49 : base(game, pos, size, shape) 43 50 { 51 health = 3; 44 52 damage = 2; 45 53 Color = Color.Red; … … 59 67 Animation.Start(); 60 68 } 69 70 public override bool hit(int damage) 71 { 72 TheDungeonGame.soundEffects[3].Play(); 73 return base.hit(damage); 74 } 61 75 } 62 76 … … 66 80 : base(game, pos, size, shape) 67 81 { 82 health = 2; 68 83 damage = 2; 69 84 Color = Color.Green; … … 84 99 Animation.Start(); 85 100 } 101 102 public override bool hit(int damage) 103 { 104 TheDungeonGame.soundEffects[3].Play(); 105 return base.hit(damage); 106 } 86 107 } 87 108 … … 91 112 : base(game, pos, size, shape) 92 113 { 114 health = 1; 93 115 damage = 1; 94 116 Color = Color.Blue; … … 109 131 Animation.Start(); 110 132 CanRotate = false; 133 } 134 135 public override bool hit(int damage) 136 { 137 TheDungeonGame.soundEffects[2].Play(); 138 return base.hit(damage); 111 139 } 112 140 } … … 129 157 130 158 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"); 131 163 132 164 public EntityBossMario(TheDungeonGame game, Vector pos, Vector size, Shape shape) … … 167 199 168 200 Brain = randomBrain; 169 Brain.Active = true;201 Brain.Active = false; 170 202 CanRotate = false; 171 203 Animation = normalWalkingAnimation; 172 204 Animation.Start(); 173 brainTimer.Start();205 174 206 Collided += collided; 175 207 } … … 185 217 public override bool hit(int damage) 186 218 { 219 hitSound.Play(); 187 220 if (health <= 35 && !isPowerUpped) 188 221 upgradeMario(); … … 193 226 private void upgradeMario() 194 227 { 195 Console.WriteLine("Upgrading...");196 228 if (isPowerUpped) return; 197 229 198 damage = 2; 230 upgradeSound.Play(); 231 damage = 1; 199 232 isPowerUpped = true; 200 233 Animation = powerupWalkingAnimation; … … 204 237 randomMoveTimer.Timeout += perfomAttack2; 205 238 followingSpeed = 220; 206 randomSpeed = 1500; 239 randomSpeed = 15000; 240 } 241 242 public void enableMovement() 243 { 244 brainTimer.Start(); 207 245 } 208 246 … … 289 327 if (usedTurtles) return; 290 328 329 attackSound.Play(); 291 330 int turtleAmount = amount; 292 331 for (int i = 0; i < turtleAmount; i++) -
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/Player.cs
r3624 r3628 40 40 private bool isAnimationRunning = false; 41 41 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) 43 45 : base(playerWidth, playerHeight) 44 46 { … … 48 50 CanRotate = false; 49 51 setupKeys(); 50 idleTexture = texture;52 idleTexture = TheDungeonGame.LoadImage("animations/player/idle"); 51 53 Image = idleTexture; 52 54 for (int i = 0; i < walkingImages.Length; i++) … … 123 125 { 124 126 playerHealth.Value -= damage; 127 hitSound.Play(); 125 128 if (playerHealth.Value <= 0) 126 129 { 127 130 showLostScreen(); 128 } 129 131 } 130 132 } 131 133 -
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/TheDungeonGame.cs
r3624 r3628 27 27 private bool moveCamera = false; 28 28 29 public Image playerPic = LoadImage("player");30 29 public List<Image> levelTopBottoms = new List<Image>(); 31 30 public List<Image> levelLeftRights = new List<Image>(); … … 61 60 soundPlayer = MediaPlayer; 62 61 63 player = new Player(this, Vector.Zero , playerPic);62 player = new Player(this, Vector.Zero); 64 63 player.setupWeapon(); 65 64 … … 84 83 soundEffects.Add(LoadSoundEffect("sound/door_close")); 85 84 soundEffects.Add(LoadSoundEffect("sound/door_open")); 85 soundEffects.Add(LoadSoundEffect("sound/bug_hit")); 86 soundEffects.Add(LoadSoundEffect("sound/zombie_hit")); 86 87 } 87 88 … … 157 158 EntityBossMario mario = (EntityBossMario)player.currentRoom.getEntityAt(3, 3); 158 159 gui.setupBossGauge(mario); 160 mario.enableMovement(); 159 161 } 160 162 } -
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGameContent/TheDungeonGameContent.contentproj
r3624 r3628 70 70 <Processor>TextureProcessor</Processor> 71 71 </Compile> 72 <Compile Include="player.png">73 <Name>player</Name>74 <Importer>TextureImporter</Importer>75 <Processor>TextureProcessor</Processor>76 </Compile>77 72 </ItemGroup> 78 73 <ItemGroup> … … 258 253 <Importer>TextureImporter</Importer> 259 254 <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> 260 291 </Compile> 261 292 </ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.