- Timestamp:
- 2013-07-03 14:12:03 (10 years ago)
- Location:
- 2013/27/TeemuM/Game/Game/Game
- Files:
-
- 2 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2013/27/TeemuM/Game/Game/Game
-
Property
svn:ignore
set to
bin
obj
-
Property
svn:ignore
set to
-
2013/27/TeemuM/Game/Game/Game/Player.cs
r4388 r4399 9 9 public class Player : PhysicsObject 10 10 { 11 const double default MoveSpeed = 1000;12 const double defaultWeaponPower = 10;11 const double defaultSpeed = 1000; 12 const int defaultPower = 10000; 13 13 private static Image playerImage = Game.LoadImage("Player"); 14 14 15 15 Weapon weapon; 16 double speed = defaultMoveSpeed; 17 double power = defaultWeaponPower; 18 IntMeter healt; 16 double speed = defaultSpeed; 17 int power = defaultPower; 18 private int _health = 0; 19 public int health 20 { 21 get 22 { 23 return _health; 24 } 25 set 26 { 27 if (value == 0) 28 Game.MessageDisplay.Add("GAME OVER!"); 29 _health = value; 30 } 31 } 19 32 20 public Player(double width, double height, int healt , bool addDefaultControls) : base(width, height)33 public Player(double width, double height, int health, bool addDefaultControls) : base(width, height) 21 34 { 22 35 this.Tag = "player"; … … 25 38 this.LinearDamping = 0.9; 26 39 27 healt = new IntMeter(healt, 0, healt);40 this.health = health; 28 41 29 42 if (addDefaultControls) … … 37 50 if (type == "speed") 38 51 { 39 speed = default MoveSpeed + value;52 speed = defaultSpeed + value; 40 53 return true; 41 54 } … … 54 67 if (weapon != null) 55 68 { 69 weapon.ProjectileCollision = ProjectileHanlder; 56 70 weapon.Angle = Angle.FromDegrees(90); 57 71 this.Add(weapon); … … 59 73 } 60 74 return false; 75 } 76 77 private void ProjectileHanlder(PhysicsObject projectile, PhysicsObject target) 78 { 79 if (target is Zombie1) 80 { 81 82 } 61 83 } 62 84 … … 89 111 if (weapon != null) 90 112 { 113 weapon.Power.Value = power; 91 114 weapon.Shoot(); 92 115 }
Note: See TracChangeset
for help on using the changeset viewer.