source: 2016/27/VerttiH/Pong/Pong/Pong/Pong.cs @ 7691

Revision 7691, 848 bytes checked in by karkaite, 3 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        Vector impulssi = new Vector(500.0, 0.0);
17        pallo.Hit(impulssi);
18
19        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
20    }
21
22    void LuoKentta()
23    {
24         pallo = new PhysicsObject(40.0, 40.0);
25        pallo.Shape = Shape.Circle;
26        Add(pallo);
27
28       
29        Level.CreateBorders(1.0, false);
30        Level.Background.Color = Color.Black;
31
32       
33        pallo.X = -200.0;
34        pallo.Y = 0.0;
35        pallo.Restitution = 1.0;
36
37        Camera.ZoomToLevel();
38    }
39}
40   
Note: See TracBrowser for help on using the repository browser.