- Timestamp:
- 2011-06-29 14:46:44 (12 years ago)
- Location:
- 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/GenCharacter.cs
r2261 r2300 13 13 // The maximum amount of hit points a player can have, which is currently defined as 100. 14 14 // This is done so that when/if a player receives a health replenishment, it won't go over the limit. 15 /*protected int _maxHP; 16 15 17 protected int maxHP 16 18 { 17 get { return maxHP;}18 } 19 get {return _maxHP;} 20 }*/ 19 21 20 22 // The constructor that just relays the variables forward -
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Player.cs
r2286 r2300 9 9 { 10 10 const int speed = 200; 11 const int jumpSpeed = 1000;11 const int jumpSpeed = 500; 12 12 const int mass = 10; 13 13 Image portrait = Game.LoadImage("Images/character"); … … 15 15 16 16 Timer walker; 17 18 17 19 18 public Player(double width, double height, Shape shape) … … 25 24 26 25 walker = new Timer(); 27 walker.Interval = 1.0;26 walker.Interval = 0.7; 28 27 walker.Trigger += playWalkingSound; 29 28 29 this.Weapon = new Pistol(20.0, 10.0); 30 30 } 31 31 … … 35 35 Game.Keyboard.Listen(Key.Left, ButtonState.Down, moveLeft, "Moves left", speed); 36 36 Game.Keyboard.Listen(Key.Up, ButtonState.Down, jump, "Jumps", jumpSpeed); 37 Game.Keyboard.Listen(Key.Space, ButtonState.Pressed, shoot, "Shoots"); 38 } 39 40 private void shoot() 41 { 42 this.Weapon.Shoot(); 37 43 } 38 44 -
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Weapons.cs
r2290 r2300 5 5 using Jypeli.Effects; 6 6 using Jypeli.Widgets; 7 8 public class Pistol : Weapon 9 { 10 public Pistol(double width, double height) 11 : base(width, height) 12 { 13 Image = Game.LoadImage("Images/gausspistol"); 14 AttackSound = Game.LoadSoundEffect("Sounds/pistolshot"); 15 AmmoIgnoresGravity = true; 16 } 17 18 protected override PhysicsObject CreateProjectile() 19 { 20 return new Projectile(1, 1, Color.Aqua); 21 } 22 }
Note: See TracChangeset
for help on using the changeset viewer.