source: 2015/26/Tuisku/counter food/counter food/counter food/counter_food.cs @ 6140

Revision 6140, 2.1 KB checked in by iisaaira, 8 years ago (diff)
Line 
1using System;
2using System.Collections.Generic;
3using Jypeli;
4using Jypeli.Assets;
5using Jypeli.Controls;
6using Jypeli.Effects;
7using Jypeli.Widgets;
8
9public class counter_food : PhysicsGame
10{
11   
12    IntMeter pisteLaskuri;
13    IntMeter pisteLaskuri2;
14
15
16    public override void Begin()
17    {
18        kartta();
19        pelaaja1();
20        pelaaja2();
21        LuoPistelaskuri();
22        LuoPistelaskuri2();
23
24    }
25
26    void kartta()
27    {
28        PhysicsObject lattia = new PhysicsObject(3000.0, 100.0);
29        lattia.Shape = Shape.Rectangle;
30        lattia.Color = Color.DarkBrown;
31        Add(lattia);
32
33        Level.Background.Color = Color.Green;
34        lattia.Y = (-500.0);
35
36    }
37
38
39    void pelaaja1()
40    {
41        PhysicsObject h = new PhysicsObject(20.0, 20.0);
42        h.Shape = Shape.Rectangle;
43        h.Color = Color.Beige;
44        Add(h);
45        h.X = (900.0);
46        h.Y = (-430);
47
48    }
49
50    void pelaaja2()
51    {
52        PhysicsObject p = new PhysicsObject(20.0, 20.0);
53        p.Shape = Shape.Circle;
54        p.Color = Color.Red;
55        Add(p);
56        p.X = (-900.0);
57        p.Y = (-430.0);
58
59    }
60
61   
62   
63
64
65    void LuoPistelaskuri()
66    {
67        pisteLaskuri = new IntMeter(0);
68
69        Label pisteNaytto = new Label();
70        pisteNaytto.X = Screen.Left + 100;
71        pisteNaytto.Y = Screen.Top - 100;
72        pisteNaytto.TextColor = Color.Black;
73        pisteNaytto.Color = Color.White;
74        pisteNaytto.Title = "Tapot";
75
76        pisteNaytto.BindTo(pisteLaskuri);
77        Add(pisteNaytto);
78    }
79    void LuoPistelaskuri2()
80    {
81        pisteLaskuri2 = new IntMeter(0);
82
83        Label pisteNaytto2 = new Label();
84        pisteNaytto2.X = Screen.Right + 100;
85        pisteNaytto2.Y = Screen.Top - 100;
86        pisteNaytto2.TextColor = Color.Black;
87        pisteNaytto2.Color = Color.White;
88        pisteNaytto2.Title = "Tapot";
89
90        pisteNaytto2.BindTo(pisteLaskuri);
91        Add(pisteNaytto2);
92    }
93   
94
95
96
97}
98
99
100
101
102
103
104
105   
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
Note: See TracBrowser for help on using the repository browser.