source: 2013/27/AkseliJ/Pong/Pong/Pong/Pong.cs @ 4331

Revision 4331, 1.4 KB checked in by akansaja, 10 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
12    int luku = 1;
13    PhysicsObject pallo;
14
15    public override void Begin()
16    {
17        // TODO: Kirjoita ohjelmakoodisi tähän
18        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli");
19        //Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
20        LuoKentta();
21    }
22
23    void 
24
25
26    void LuoKentta() {
27
28        pallo = new PhysicsObject(100, 100, Shape.Circle);
29        pallo.Color = Color.Beige;
30        this.Add(pallo);
31        Level.BackgroundColor = Color.AshGray;
32        Mouse.IsCursorVisible = true;
33        Vector sijainti = Mouse.PositionOnScreen;
34        Level.CreateBorders(1.0, false);
35        Vector impulssi = new Vector(0, -250);
36
37        PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0);
38        maila.Shape = Shape.Rectangle;
39        maila.X = Level.Left + 20.0;
40        maila.Y = 0.0;
41        maila.Restitution = 1.0;
42        Add(maila);
43
44        PhysicsObject maila2 = PhysicsObject.CreateStaticObject(20.0, 100.0);
45        maila2.Shape = Shape.Rectangle;
46        maila2.X = Level.Right - 20.0;
47        maila2.Y = 0.0;
48        maila2.Restitution = 1.0;
49        Add(maila2);
50   
51    }
52
53
54}
Note: See TracBrowser for help on using the repository browser.