Changeset 2354 for 2011/26


Ignore:
Timestamp:
2011-06-30 13:00:28 (8 years ago)
Author:
teeevasa
Message:

added keyboard controls for menu

Location:
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Peli.cs

    r2349 r2354  
    1919    { 
    2020        menuCreate(); 
    21          
    2221    } 
    2322 
     
    2726        titleMenu = new List<Label>(); 
    2827 
    29         Label button1 = new Label("Start Game"); 
    30         button1.Position = new Vector(0, 40); 
    31         titleMenu.Add(button1); 
     28        Label startGameButton = new Label("Start Game"); 
     29        startGameButton.Position = new Vector(0, 40); 
     30        titleMenu.Add(startGameButton); 
    3231 
    33         Label button2 = new Label("Exit Game"); 
    34         button2.Position = new Vector(0, -40); 
    35         titleMenu.Add(button2); 
     32        Label exitGameButton = new Label("Exit Game"); 
     33        exitGameButton.Position = new Vector(0, -40); 
     34        titleMenu.Add(exitGameButton); 
    3635 
    3736        foreach (Label titleMenuScreen in titleMenu) 
     
    4039        } 
    4140 
    42         Mouse.ListenOn(button1, MouseButton.Left, ButtonState.Pressed, StartGame, null); 
    43         Mouse.ListenOn(button2, MouseButton.Left, ButtonState.Pressed, Exit, null); 
     41        Mouse.ListenOn(startGameButton, MouseButton.Left, ButtonState.Pressed, startGame, null); 
     42        Keyboard.Listen(Key.Enter, ButtonState.Pressed, startGame, null); 
     43 
     44        Mouse.ListenOn(exitGameButton, MouseButton.Left, ButtonState.Pressed, Exit, null); 
     45        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, null); 
    4446 
    4547        Mouse.IsCursorVisible = true; 
     
    6365    } 
    6466 
    65     void StartGame() 
     67    void startGame() 
    6668    { 
    6769        ClearAll(); 
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Weapons.cs

    r2351 r2354  
    1616        InfiniteAmmo = true; 
    1717        Power.DefaultValue = 1000; 
     18        TimeBetweenUse = TimeSpan.FromSeconds(0.4); 
    1819    } 
    1920 
Note: See TracChangeset for help on using the changeset viewer.