Ignore:
Timestamp:
2013-07-02 15:32:09 (9 years ago)
Author:
janiemit
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2013/27/TeemuM/Game/Game/Game/Player.cs

    r4353 r4377  
    1111    const double defaultMoveSpeed = 1000; 
    1212    double speed = defaultMoveSpeed; 
     13    static Image pelaaja = Game.LoadImage("playerImage"); 
    1314 
    1415    public Player(Game game, double width, double height) : base(width, height) 
    1516    { 
    1617        this.Shape = Shape.Circle; 
    17         this.Image = G.game.playerImage; 
     18        this.Image = pelaaja; 
    1819        this.LinearDamping = 0.9; 
    1920         
     
    2425    public void SetControls() 
    2526    { 
    26         G.game.Keyboard.Listen(Key.W, ButtonState.Down, delegate { this.Push(new Vector(0, speed)); }, null); 
    27         G.game.Keyboard.Listen(Key.S, ButtonState.Down, delegate { this.Push(new Vector(0, -speed)); }, null); 
    28         G.game.Keyboard.Listen(Key.A, ButtonState.Down, delegate { this.Push(new Vector(-speed, 0)); }, null); 
    29         G.game.Keyboard.Listen(Key.D, ButtonState.Down, delegate { this.Push(new Vector(speed, 0)); }, null); 
    30         G.game.Mouse.Listen(MouseButton.Left, ButtonState.Pressed, Shoot, null); 
     27        Game.Keyboard.Listen(Key.W, ButtonState.Down, delegate { this.Push(new Vector(0, speed)); }, null); 
     28        Game.Keyboard.Listen(Key.S, ButtonState.Down, delegate { this.Push(new Vector(0, -speed)); }, null); 
     29        Game.Keyboard.Listen(Key.A, ButtonState.Down, delegate { this.Push(new Vector(-speed, 0)); }, null); 
     30        Game.Keyboard.Listen(Key.D, ButtonState.Down, delegate { this.Push(new Vector(speed, 0)); }, null); 
     31        Game.Mouse.Listen(MouseButton.Left, ButtonState.Pressed, Shoot, null); 
    3132    } 
    3233 
Note: See TracChangeset for help on using the changeset viewer.