Changeset 2300


Ignore:
Timestamp:
2011-06-29 14:46:44 (8 years ago)
Author:
teeevasa
Message:
 
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  
    1313    // The maximum amount of hit points a player can have, which is currently defined as 100. 
    1414    // 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 
    1517    protected int maxHP 
    1618    { 
    17         get { return maxHP; } 
    18     } 
     19        get {return _maxHP;} 
     20    }*/ 
    1921 
    2022    // The constructor that just relays the variables forward 
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Player.cs

    r2286 r2300  
    99{ 
    1010    const int speed = 200; 
    11     const int jumpSpeed = 1000; 
     11    const int jumpSpeed = 500; 
    1212    const int mass = 10; 
    1313    Image portrait = Game.LoadImage("Images/character"); 
     
    1515 
    1616    Timer walker; 
    17      
    1817 
    1918        public Player(double width, double height, Shape shape) 
     
    2524 
    2625        walker = new Timer(); 
    27         walker.Interval = 1.0; 
     26        walker.Interval = 0.7; 
    2827        walker.Trigger += playWalkingSound; 
    2928 
     29        this.Weapon = new Pistol(20.0, 10.0); 
    3030        } 
    3131 
     
    3535        Game.Keyboard.Listen(Key.Left, ButtonState.Down, moveLeft, "Moves left", speed); 
    3636        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(); 
    3743    } 
    3844 
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Weapons.cs

    r2290 r2300  
    55using Jypeli.Effects; 
    66using Jypeli.Widgets; 
     7 
     8public 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.