source: 2017/30/JouniP/Pong/Pong/Pong/Pong.cs @ 9021

Revision 9021, 969 bytes checked in by jotapoti, 6 years ago (diff)

Pong-peliä aloiteltu

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        // moi
15                                                // x,   y
16        PhysicsObject pallo = new PhysicsObject(40.0, 40.0);
17        pallo.Shape = Shape.Circle;
18        pallo.Color = Color.HotPink;
19        pallo.X = -150.0;
20        pallo.Y = 150.0;
21        Add(pallo);
22
23        Level.Background.Color = Color.Black;
24
25        Vector impulssi = new Vector(-200.0, 10.0);
26        pallo.Hit(impulssi);
27
28        Level.CreateBorders();
29
30        // lisätään näppäimiä:
31        //no nyt tää on kommentti PhoneBackButton.Listen(ConfirmExit, "Lopeta peli");
32        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
33    }
34}
Note: See TracBrowser for help on using the repository browser.