source: 2016/27/OnniK/Pong/Pong/Pong/Pong.cs @ 7690

Revision 7690, 829 bytes checked in by karkaite, 5 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 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.