source: 2016/koodauskerho/Aapok/ping pong/ping pong/ping_pong/ping_pong.cs @ 8314

Revision 8314, 884 bytes checked in by tesatapa, 3 years ago (diff)

aloin pong

Line 
1using System;
2using System.Collections.Generic;
3using Jypeli;
4using Jypeli.Assets;
5using Jypeli.Controls;
6using Jypeli.Effects;
7using Jypeli.Widgets;
8
9public class ping_pong : PhysicsGame
10{
11    PhysicsObject pallo;
12    public override void Begin()
13    {
14        LuoKentta();
15
16        Vector impulssi = new Vector(500.0, 0.0);
17        pallo.Hit(impulssi);
18        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
19    }
20
21    void LuoKentta()
22    {
23        pallo = new PhysicsObject(40.0, 40.0);
24        pallo.Shape = Shape.Circle;
25        pallo.X = -200.0;
26        pallo.Y = 0.0;
27        pallo.Restitution = 1.0;
28        Add(pallo);
29
30
31
32        Level.CreateBorders(1.0, false);
33        Level.Background.Color = Color.Purple;
34        // TODO: Kirjoita ohjelmakoodisi tähän
35
36        Camera.ZoomToLevel();
37    }
38}
39
40
Note: See TracBrowser for help on using the repository browser.