Changeset 4377


Ignore:
Timestamp:
2013-07-02 15:32:09 (7 years ago)
Author:
janiemit
Message:
 
Location:
2013/27/TeemuM/Game/Game
Files:
1 added
4 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 
  • 2013/27/TeemuM/Game/Game/Game/UI.cs

    r4358 r4377  
    1010using Jypeli.Widgets; 
    1111 
    12 class UI 
     12public class UI 
    1313{ 
    14     public static int Menu() 
     14    public static int Menu(String title, String[] options, Action selectionHandler) 
    1515    { 
    1616        int selectedItem = -1; 
    17         MultiSelectWindow Menu = new MultiSelectWindow("Welcome to Game", "Start Game", "Scoreboard", "Exit"); 
    18         Menu.ItemSelected += delegate(int selected) { selectedItem = selected; }; 
    19         G.game.Add(Menu); 
     17        MultiSelectWindow Menu = new MultiSelectWindow("Welcome to Game", options); 
     18        Menu.ItemSelected += delegate(int selected) { selectionHandler(selected); }; 
     19        Add(Menu); 
    2020        return selectedItem; 
    2121    } 
Note: See TracChangeset for help on using the changeset viewer.