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 Pong : PhysicsGame |
---|
10 | { |
---|
11 | PhysicsObject pallo; |
---|
12 | public override void Begin() |
---|
13 | { |
---|
14 | LuoKentta(); |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); |
---|
19 | |
---|
20 | |
---|
21 | Vector implussi = new Vector(500.0, 0.0); |
---|
22 | pallo.Hit(implussi); |
---|
23 | |
---|
24 | } |
---|
25 | void LuoKentta() |
---|
26 | { |
---|
27 | pallo = new PhysicsObject(40.0, 40.0); |
---|
28 | pallo.Shape = Shape.Circle; |
---|
29 | pallo.X = -200.0; |
---|
30 | pallo.Y = 0.0; |
---|
31 | pallo.Restitution = 1.0; |
---|
32 | Add(pallo); |
---|
33 | |
---|
34 | Level.CreateBorders(1.0, false); |
---|
35 | Level.Background.Color = Color.Black; |
---|
36 | |
---|
37 | Camera.ZoomToLevel(); |
---|
38 | } |
---|
39 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.