Revision 9021,
969 bytes
checked in by jotapoti, 6 years ago
(diff) |
Pong-peliä aloiteltu
|
Line | |
---|
1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using Jypeli; |
---|
4 | using Jypeli.Assets; |
---|
5 | using Jypeli.Controls; |
---|
6 | using Jypeli.Effects; |
---|
7 | using Jypeli.Widgets; |
---|
8 | |
---|
9 | public 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.