source: 2013/26/JustusK/Pong/Pong/Pong/Pong.cs @ 4182

Revision 4182, 837 bytes checked in by wiaukota, 6 years ago (diff)

Talletus.

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   
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.