source: 2015/26/RonjaT/Pong/Pong/Pong/Pong.cs @ 6128

Revision 6128, 833 bytes checked in by jotapoti, 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 
12    PhysicsObject pallo;
13    public override void Begin()
14    {
15        LuoKentta();
16         
17        Vector impulssi = new Vector(500.0, 0.0);
18        pallo.Hit(impulssi);
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
26        pallo.Shape = Shape.Circle;
27        pallo.X = -200.0;
28        pallo.Y = 0.0;
29        pallo.Restitution = 1.0;
30        Add(pallo);
31
32        Level.CreateBorders(1.0, false);
33        Level.Background.Color = Color.Black;
34        Camera.ZoomToLevel();
35    }
36
37}
Note: See TracBrowser for help on using the repository browser.