Changeset 2193 for 2011/26/VilleK
- Timestamp:
- 2011-06-28 10:45:24 (10 years ago)
- Location:
- 2011/26/VilleK/ponggi/ponggi
- Files:
-
- 23 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/26/VilleK/ponggi/ponggi/ponggi/Peli.cs
r2183 r2193 18 18 LuoKentta(); 19 19 AsetaOhjaimet(); 20 aloita(); 20 21 21 22 23 Vector impulssi = new Vector(500.0, 0.0); 24 pallo.Hit(impulssi); 25 } 26 void LuoKentta() 27 { 22 } 23 void LuoKentta() 24 { 28 25 pallo = new PhysicsObject(70.0, 70.0); 29 26 Add(pallo); … … 39 36 LuoMaila(Level.Left + 20.0, 0.0); 40 37 LuoMaila(Level.Right - 20.0, 0.0); 41 }void AsetaOhjaimet() 38 } 39 void AsetaOhjaimet() 42 40 41 { 42 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Poistu"); 43 Keyboard.Listen( Key.a, ButtonState.Down liiikutamailaaylös, ); 44 A, ButtonState.Released, PysaytaMaila, null ); 45 46 } 47 void AsetaNopeus( PhysicsObject maila, Vector nopeus ) 43 48 { 44 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Poistu"); 45 Keyboard.Listen( Key.a, ButtonState.Down liiikutamailaaylös 46 } 49 maila.Velocity = nopeus; 50 } 47 51 48 49 52 void LuoMaila(double x, double y) 53 { 50 54 PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 51 55 maila.Shape = Shape.Rectangle; 52 maila .X = x;53 maila .Y = y;56 maila1.X = x; 57 maila2.Y = y; 54 58 maila.Restitution = 1.0; 55 59 Add(maila); 56 57 58 60 } 61 void aloita() 62 { 59 63 60 64 Vector impulssi = new Vector(500.0, 0.0); … … 62 66 } 63 67 64 } 68 }
Note: See TracChangeset
for help on using the changeset viewer.