source: 2017/24/TomiK/Pong/Pong/Pong/Pong.cs @ 8506

Revision 8506, 850 bytes checked in by npo17_15, 2 years ago (diff)

vaihe 3

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
13    public override void Begin()
14    {
15        PhysicsObject pallo = new PhysicsObject(40.0, 40.0);
16        LuoKentta();
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
23
24        Level.CreateBorders();
25        Camera.ZoomToLevel();
26
27    }
28
29void LuoKentta()
30{
31         PhysicsObject pallo = new PhysicsObject(40.0, 40.0);
32         pallo.Shape = Shape.Circle;
33         pallo.Restitution = 1.0;
34         Add(pallo);
35
36        Level.CreateBorders();
37
38        Camera.ZoomToLevel();
39    }
40   
41
42
43}
Note: See TracBrowser for help on using the repository browser.