source: 2012/27/Alex/pong/pong/pong/pong.cs @ 3453

Revision 3453, 955 bytes checked in by fralnauk, 8 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    public override void Begin()
12    {
13        // TODO: Kirjoita ohjelmakoodisi tähän
14
15        LuoKentta();
16
17        Vector impulssi = new Vector(5000.0, 0.0);
18        ony.Hit(impulssi);
19       
20        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli");
21        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
22   
23   }
24
25    void LuoKentta()
26    {
27        PhysicsObject ony = new PhysicsObject(551.0, 5.0);
28        ony.Shape = Shape.Triangel;
29        ony.Color = Color.Blue;
30        ony.Y = 0.0;
31        ony.X = -200.0;
32        Add(ony);
33        Level.CreateBorders(1.0, false);
34        ony.Restitution = 1.0;
35        Level.BackgroundColor = Color.Gray;
36
37        Camera.ZoomToLevel();
38
39    }
40}
Note: See TracBrowser for help on using the repository browser.