source: 2011/26/JuhoK/SFN/SFN/SFN/Peli.cs @ 2198

Revision 2198, 1.6 KB checked in by jumakall, 8 years ago (diff)

Pelin valikko valmis.

Line 
1using System;
2using System.Collections.Generic;
3using Jypeli;
4using Jypeli.Assets;
5using Jypeli.Controls;
6using Jypeli.Effects;
7using Jypeli.Widgets;
8
9public class Peli : PhysicsGame
10{
11    Image MenuBackround = LoadImage("MenuBackround");
12    public override void Begin()
13    {
14        Keyboard.Listen(Key.Escape, ButtonState.Released, Exit, null);
15        Mouse.IsCursorVisible = true;
16        CreateMenu();
17    }
18
19    void CreateMenu()
20    {
21        //Set menu backround
22        Level.Background.Image = MenuBackround;
23
24        //Quit game button
25        PushButton quit_game = new PushButton("Quit game");
26        quit_game.Clicked += new Action(quit_game_Clicked);
27        quit_game.Position = new Vector(380.0, -50.0);
28        Add(quit_game);
29
30        //Load game button
31        PushButton load_game = new PushButton("Load game");
32        load_game.Clicked += new Action(load_game_Clicked);
33        load_game.Position = new Vector(200.0, -50.0);
34        Add(load_game);
35
36        //New game button
37        PushButton new_game = new PushButton("New game");
38        new_game.Clicked += new Action(new_game_Clicked);
39        new_game.Position = new Vector(20.0, -50.0);
40        Add(new_game);
41    }
42
43    void new_game_Clicked()
44    {
45        MessageDisplay.Add("Can't start new game. Game engine not availible.");
46    }
47
48    void load_game_Clicked()
49    {
50        MessageDisplay.Add("Can't load game. Game save system not availible.");
51    }
52
53    void quit_game_Clicked()
54    {
55        //Crediittejä tänne?
56        Exit();
57    }
58}
Note: See TracBrowser for help on using the repository browser.