Changeset 7709 for 2016/27/OnniK/Pong/Pong/Pong
- Timestamp:
- 2016-07-04 14:52:54 (5 years ago)
- Location:
- 2016/27/OnniK/Pong/Pong/Pong
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/27/OnniK/Pong/Pong/Pong/Pong.cs
r7690 r7709 13 13 { 14 14 LuoKentta(); 15 AsetaOhjaimet(); 16 AloitaPeli(); 17 } 18 void AsetaOhjaimet() 19 { 20 Keyboard.Listen(Key.A, ButtonState.Down, LiikutaMaila1Ylos, "Pelaaja 1: Liikuta mailaa ylös"); 21 Keyboard.Listen(Key.A, ButtonState.Released, PysaytaMaila1, null); 22 23 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 24 15 25 16 17 18 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 19 20 21 Vector implussi = new Vector(500.0, 0.0); 22 pallo.Hit(implussi); 26 27 } 28 void LuoMaila(double x, double y) 29 { 30 PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 31 maila.Shape = Shape.Rectangle; 32 maila.X = 33 maila.Y = 34 maila.Restitution = 1.0; 35 Add(maila); 23 36 24 37 } 25 38 void LuoKentta() 26 39 { 27 pallo = new PhysicsObject(40.0, 40.0); 40 41 pallo = new PhysicsObject(40.0, 40.0); 28 42 pallo.Shape = Shape.Circle; 29 43 pallo.X = -200.0; … … 32 46 Add(pallo); 33 47 48 LuoMaila(Level.Left + 20.0, 0.0); 49 LuoMaila(Level.Right - 20.0, 0.0); 50 51 34 52 Level.CreateBorders(1.0, false); 35 53 Level.Background.Color = Color.Black; … … 37 55 Camera.ZoomToLevel(); 38 56 } 57 void AloitaPeli() 58 { 59 Vector implussi = new Vector(500.0, 0.0); 60 pallo.Hit(implussi); 61 62 void LiikutaMailaaYlos(PhysicsObject maila) 63 { 64 Vector nopeus 65 } 66 67 68 } 39 69 } 70
Note: See TracChangeset
for help on using the changeset viewer.