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