Changeset 556
- Timestamp:
- 2010-06-08 14:56:35 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/23/juhkuska/Pong/Peli.cs
r539 r556 8 8 public class Peli : PhysicsGame 9 9 { 10 PhysicsObject maila1; 11 PhysicsObject maila2; 10 12 PhysicsObject pallo; 11 13 protected override void Begin() 12 14 { 13 15 LuoKentta(); 16 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "poistu"); 14 17 Aloitapeli(); 15 18 … … 24 27 pallo.Restitution = 1.0; 25 28 Add(pallo); 26 LuoMaila(Level.Left + 20.0, 0.0);27 LuoMaila(Level.Right - 20.0, 0.0);29 maila1 = LuoMaila(Level.Left + 20.0, 0.0); 30 maila2 = LuoMaila(Level.Right - 20.0, 0.0); 28 31 Level.CreateBorders(0.8, false); 29 32 Level.BackgroundColor = Color.Pink; … … 36 39 } 37 40 38 voidLuoMaila(double x, double y)41 PhysicsObject LuoMaila(double x, double y) 39 42 { 40 43 PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); … … 44 47 maila.Restitution = 1.0; 45 48 Add(maila); 49 return maila; 46 50 47 51 52 } 53 void AsetaOhjaimet() 54 { 55 Keyboard.Listen(Key.A, ButtonState.Pressed, LiikutaMailaaYlos, "Pelaaja 1: Liikuta mailaa ylös"); 56 Keyboard.Listen(Key.A, ButtonState.Released, Pysaytamaila, null); 57 Keyboard.Listen(Key.Escape, ButtonState.Pressed,Exit, "poistu"); 48 58 } 49 59
Note: See TracChangeset
for help on using the changeset viewer.