source: 2017/27/MikaelL/pong/pong/pong/pong.cs @ 8830

Revision 8830, 849 bytes checked in by npo17_33, 2 years ago (diff)

Tein peliä

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