Line | |
---|
1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using Jypeli; |
---|
4 | using Jypeli.Assets; |
---|
5 | using Jypeli.Controls; |
---|
6 | using Jypeli.Effects; |
---|
7 | using Jypeli.Widgets; |
---|
8 | |
---|
9 | public class G : PhysicsGame |
---|
10 | { |
---|
11 | public static G game; |
---|
12 | public Image playerImage = LoadImage("Player"); |
---|
13 | |
---|
14 | public override void Begin() |
---|
15 | { |
---|
16 | game = this; |
---|
17 | |
---|
18 | Player pelaaja = new Player(this, 50, 50); |
---|
19 | Add(pelaaja); |
---|
20 | |
---|
21 | ScoreMeter(); |
---|
22 | |
---|
23 | PhoneBackButton.Listen(Exit, "Lopeta peli"); |
---|
24 | Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Lopeta peli"); |
---|
25 | |
---|
26 | Mouse.IsCursorVisible = true; |
---|
27 | } |
---|
28 | |
---|
29 | IntMeter scoreboard; |
---|
30 | |
---|
31 | void ScoreMeter() |
---|
32 | { |
---|
33 | scoreboard = new IntMeter(0); |
---|
34 | scoreboard.AddOverTime(100, 1); |
---|
35 | |
---|
36 | Label ScoreScreen = new Label(); |
---|
37 | ScoreScreen.X = 0; |
---|
38 | ScoreScreen.Y = Screen.Bottom + 100; |
---|
39 | ScoreScreen.TextColor = Color.Black; |
---|
40 | ScoreScreen.Color = Color.White; |
---|
41 | ScoreScreen.BindTo(scoreboard); |
---|
42 | Add(ScoreScreen); |
---|
43 | } |
---|
44 | |
---|
45 | protected override void Update(Microsoft.Xna.Framework.GameTime gameTime) |
---|
46 | { |
---|
47 | |
---|
48 | base.Update(gameTime); |
---|
49 | } |
---|
50 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.