- Timestamp:
- 2012-07-06 11:44:00 (11 years ago)
- Location:
- 2012/27/DenisZ/TheDungeonGame/TheDungeonGame
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/EntityTemplates.cs
r3633 r3643 166 166 { 167 167 damage = 1; 168 health = 75;168 health = 120; 169 169 followingSpeed = 150; 170 170 randomSpeed = 10000; … … 218 218 { 219 219 hitSound.Play(); 220 if (health <= 35&& !isPowerUpped)220 if (health <= 50 && !isPowerUpped) 221 221 upgradeMario(); 222 222 game.gui.bossHealth.Value -= damage; -
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/InGameGui.cs
r3633 r3643 39 39 Add(weaponSpeedText); 40 40 41 Label weaponSpeedInfo = new Label(" Weapon's speed");41 Label weaponSpeedInfo = new Label("Shooting delay"); 42 42 weaponSpeedInfo.Top += 30; 43 43 weaponSpeedInfo.Right += 90; … … 97 97 healthAmount.TextColor = Color.Red; 98 98 healthAmount.TextScale = new Vector(1.5, 1.5); 99 healthAmount.Right = Right - 40;99 healthAmount.Right = Right - 100; 100 100 101 101 Add(healthAmount); -
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/Item.cs
r3640 r3643 28 28 public virtual void onPickup(Player picker) 29 29 { 30 TheDungeonGame.soundEffects[4].Play(); 30 31 //picker.ItemInInventory = this; 31 32 //picker.updateGuiImage(); -
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/ItemEntity.cs
r3640 r3643 19 19 Image = bindedItem.itemTexture; 20 20 CanRotate = false; 21 CollisionIgnoreGroup = CollisionGroups.Rocks;22 21 } 23 22 } -
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/ItemTemplates.cs
r3640 r3643 8 8 namespace Items 9 9 { 10 public class TestItem : Item10 public class TestItem : Item 11 11 { 12 public TestItem(Image itemTexture, String name, bool usuable)13 : base(itemTexture, name, usuable)14 {12 public TestItem(Image itemTexture, String name, bool usuable) 13 : base(itemTexture, name, usuable) 14 { 15 15 16 }16 } 17 17 18 public override bool useItem(TheDungeonGame game)19 {20 if (game.Player == null) return false;18 public override bool useItem(TheDungeonGame game) 19 { 20 if (game.Player == null) return false; 21 21 22 game.Player.ItemInInventory = null;23 return true;24 }22 game.Player.ItemInInventory = null; 23 return true; 24 } 25 25 } 26 26 … … 30 30 : base(((TheDungeonGame)TheDungeonGame.Instance).objectTextures[3], "HealthPack", false) 31 31 { 32 33 32 } 34 33 … … 39 38 } 40 39 } 40 41 public class ItemAmmoDamage : Item 42 { 43 public ItemAmmoDamage() 44 : base(((TheDungeonGame)TheDungeonGame.Instance).objectTextures[5], "Damage upgrade", false) 45 { 46 } 47 48 public override void onPickup(Player picker) 49 { 50 picker.WeaponDamage++; 51 base.onPickup(picker); 52 } 53 } 54 55 public class ItemWeaponSpeed : Item 56 { 57 public ItemWeaponSpeed() 58 : base(((TheDungeonGame)TheDungeonGame.Instance).objectTextures[4], "Speed upgrade", false) 59 { 60 } 61 62 public override void onPickup(Player picker) 63 { 64 picker.WeaponSpeed -= TimeSpan.FromSeconds(0.05); 65 base.onPickup(picker); 66 } 67 } 68 69 public class ItemBulletLifeTime : Item 70 { 71 public ItemBulletLifeTime() 72 : base(((TheDungeonGame)TheDungeonGame.Instance).objectTextures[6], "Lifetime upgrade", false) 73 { 74 75 } 76 77 public override void onPickup(Player picker) 78 { 79 picker.BulletLife += TimeSpan.FromSeconds(0.05); 80 base.onPickup(picker); 81 } 82 } 41 83 } -
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/Room.cs
r3640 r3643 53 53 public void spawnRandomEntities(int entityAmount) 54 54 { 55 if (entityAmount == 0) return; 56 55 57 int entitiesSpawned = 0; 56 58 while (entitiesSpawned < entityAmount) … … 65 67 public void spawnRandomItems(int itemAmount) 66 68 { 69 if (itemAmount == 0) return; 70 67 71 int itemsSpawned = 0; 68 72 while (itemsSpawned < itemAmount) 69 73 { 70 ItemEntity item = RoomCreator.getItem(RandomGen.NextInt( 1)).createWorldObject();74 ItemEntity item = RoomCreator.getItem(RandomGen.NextInt(4)).createWorldObject(); 71 75 if (!addBlock(item, RandomGen.NextInt(bWidth - 2) + 1, RandomGen.NextInt(bHeight - 2) + 1)) 72 76 continue; -
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/RoomTemplates.cs
r3640 r3643 21 21 { 22 22 createLevelDecorations(); 23 spawnRandomItems(1);23 24 24 } 25 25 } … … 41 41 addBlock(new ObjectRock(blockWidth, blockHeight), bWidth - 1, bHeight - 1, new Vector(0, -50)); 42 42 43 spawnRandomEntities(RandomGen.NextInt(6)+1); 43 spawnRandomEntities(RandomGen.NextInt(6) + 1); 44 spawnRandomItems(RandomGen.NextInt(2)); 44 45 } 45 46 } … … 56 57 createLevelDecorations(); 57 58 58 for (int i = 0; i < 4; i++)59 for (int i = 0; i < 3; i++) 59 60 { 60 61 addBlock(new ObjectRock(blockWidth, blockHeight), 1, 1 + i, new Vector(0, -50)); 61 62 } 62 63 63 for (int i = 0; i < 4; i++)64 for (int i = 0; i < 3; i++) 64 65 { 65 66 addBlock(new ObjectRock(blockWidth, blockHeight), 8, 1 + i, new Vector(0, -50)); … … 67 68 68 69 spawnRandomEntities(RandomGen.NextInt(6) + 1); 70 spawnRandomItems(RandomGen.NextInt(2)); 69 71 } 70 72 } … … 102 104 103 105 spawnRandomEntities(RandomGen.NextInt(6) + 1); 106 spawnRandomItems(RandomGen.NextInt(2)); 104 107 } 105 108 } … … 126 129 127 130 spawnRandomEntities(RandomGen.NextInt(6) + 1); 131 spawnRandomItems(RandomGen.NextInt(2)); 128 132 } 129 133 } … … 149 153 150 154 deleteBlock(bWidth / 2 - 1, bHeight / 2); 151 spawnRandomEntities(RandomGen.NextInt(6) + 1); 155 deleteBlock(bWidth / 2, bHeight / 2); 156 spawnRandomEntities(RandomGen.NextInt(6) + 1); 157 spawnRandomItems(RandomGen.NextInt(2)); 152 158 } 153 159 } … … 172 178 173 179 spawnRandomEntities(RandomGen.NextInt(6) + 1); 180 spawnRandomItems(RandomGen.NextInt(2)); 174 181 } 175 182 } … … 237 244 if (id == 0) 238 245 item = new ItemHealth(); 246 else if (id == 1) 247 item = new ItemAmmoDamage(); 248 else if (id == 2) 249 item = new ItemWeaponSpeed(); 250 else if (id == 3) 251 item = new ItemBulletLifeTime(); 239 252 240 253 return item; -
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/TheDungeonGame.cs
r3640 r3643 108 108 objectTextures.Add(LoadImage("objects/ammo_speed")); 109 109 objectTextures.Add(LoadImage("objects/ammo_damage")); 110 objectTextures.Add(LoadImage("objects/ammo_lifetime")); 110 111 } 111 112 … … 163 164 { 164 165 EntityBossMario mario = (EntityBossMario)player.currentRoom.getEntityAt(3, 3); 166 if (mario.IsDestroyed) return; 165 167 gui.setupBossGauge(mario); 166 168 mario.enableMovement(); … … 202 204 gui = new InGameGui(this); 203 205 Add(gui); 206 gui.setupInfoMeters(); 204 207 regenerateLevel(); 205 208 } -
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGameContent/TheDungeonGameContent.contentproj
r3640 r3643 315 315 </Compile> 316 316 </ItemGroup> 317 <ItemGroup> 318 <Compile Include="objects\ammo_lifetime.png"> 319 <Name>ammo_lifetime</Name> 320 <Importer>TextureImporter</Importer> 321 <Processor>TextureProcessor</Processor> 322 </Compile> 323 </ItemGroup> 317 324 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 318 325 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.