- Timestamp:
- 2011-06-30 12:40:53 (12 years ago)
- Location:
- 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/GenCharacter.cs
r2300 r2348 31 31 32 32 // A particlular method for reducing hit points. It also handles death, when it 33 p rivatevoid reduceHitPointsBy(int reduction)33 public void reduceHitPointsBy(int reduction) 34 34 { 35 35 if (hitPoints > reduction) -
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Peli.cs
r2345 r2348 53 53 MeleeAlien addMeleeAlien() 54 54 { 55 MeleeAlien meleeAlien = new MeleeAlien(45, 80, Shape.Rectangle, 10, "Patrol");55 MeleeAlien meleeAlien = new MeleeAlien(45, 80, Shape.Rectangle, 50, "Patrol"); 56 56 return meleeAlien; 57 57 } -
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Player.cs
r2343 r2348 24 24 this.CollisionIgnoreGroup = 1; 25 25 26 // Creating the timer system that is *supposed* to enable a nice walking sound effect 26 27 walker = new Timer(); 27 28 walker.Interval = 0.7; 28 29 walker.Trigger += playWalkingSound; 29 30 31 // Creating the weapon; for now only a pistol 30 32 Pistol pistol = new Pistol(20.0, 10.0); 31 33 pistol.X = 5; 32 34 pistol.Y = 10; 33 35 this.Weapon = pistol; 36 pistol.ProjectileCollision += bulletReachedTarget; 34 37 35 pistol.ProjectileCollision += bulletReachedTarget; 38 // Collision handlers for enemies 39 AddCollisionHandler(); 36 40 } 37 41 … … 55 59 } 56 60 57 void bulletReachedTarget(PhysicsObject bullet, PhysicsObject target)61 private void bulletReachedTarget(PhysicsObject bullet, PhysicsObject target) 58 62 { 59 63 bullet.Destroy(); … … 61 65 if (target.Tag == "MeleeAlien") 62 66 { 63 target.Destroy(); 67 MeleeAlien alien = (MeleeAlien)target; 68 //alien.reduceHitPointsBy(this.Weapon.firePower()); 69 alien.reduceHitPointsBy(10); 64 70 } 65 71 } -
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Weapons.cs
r2342 r2348 24 24 return proj; 25 25 } 26 27 public int reloadTime() 28 { 29 return 1; 30 } 31 32 public int firePower() 33 { 34 return 10; 35 } 36 37 public string name() 38 { 39 return "Pistol"; 40 } 26 41 }
Note: See TracChangeset
for help on using the changeset viewer.