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 PhysicsManipulator : PhysicsGame { |
---|
10 | |
---|
11 | public override void Begin() { |
---|
12 | |
---|
13 | ChangeColor(); |
---|
14 | |
---|
15 | PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); |
---|
16 | Mouse.Listen(MouseButton.Left, ButtonState.Pressed, Hiiren1Painettu, "Painetaan hiiren vasenta nappia"); |
---|
17 | Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); |
---|
18 | } |
---|
19 | |
---|
20 | Shape RandomShape() { |
---|
21 | |
---|
22 | int ShapeValue = RandomGen.NextInt(0, 6); |
---|
23 | |
---|
24 | switch (ShapeValue) { |
---|
25 | |
---|
26 | case 0: |
---|
27 | |
---|
28 | return Shape.Circle; |
---|
29 | case 1: |
---|
30 | |
---|
31 | return Shape.Diamond; |
---|
32 | case 2: |
---|
33 | |
---|
34 | return Shape.Heart; |
---|
35 | case 3: |
---|
36 | |
---|
37 | return Shape.Star; |
---|
38 | default: |
---|
39 | |
---|
40 | return Shape.CreateRegularPolygon(RandomGen.NextInt(0, 10)); |
---|
41 | } |
---|
42 | } |
---|
43 | |
---|
44 | PhysicsObject NewObject(double sX, double sY, Shape shape) { |
---|
45 | |
---|
46 | PhysicsObject obj = new PhysicsObject(sX, sY); |
---|
47 | obj.Shape = shape; |
---|
48 | |
---|
49 | return obj; |
---|
50 | } |
---|
51 | |
---|
52 | void Hiiren1Painettu() { |
---|
53 | |
---|
54 | |
---|
55 | } |
---|
56 | |
---|
57 | void ChangeColor() { |
---|
58 | |
---|
59 | |
---|
60 | } |
---|
61 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.