source: 2016/26/PinjaV/Pong/Pong/Pong/Pong.cs @ 7512

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