source: 2012/27/EemilK/pong/pong/pong/pong.cs @ 3430

Revision 3430, 968 bytes checked in by eekrkolu, 9 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    public override void Begin()
13    {
14        // TODO: Kirjoita ohjelmakoodisi tähän
15        LuoKentta();
16        Vector impulssi = new Vector(500.0, 0.0);
17        pallo.Hit(impulssi);
18        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli");
19        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
20    }
21    void LuoKentta()
22    {
23        PhysicsObject pallo = new PhysicsObject(40.0, 40.0);
24        pallo.Shape = Shape.Circle;
25        pallo.Color = Color.Red;
26        pallo.X = -200.0;
27        pallo.Y = 0.0;
28        pallo.Restitution = 1.0;
29        Add(pallo);
30        Level.CreateBorders(1.0, false);
31        Level.BackgroundColor = Color.Black;
32        Camera.ZoomToLevel();
33    }
34}
Note: See TracBrowser for help on using the repository browser.