- Timestamp:
- 2012-04-16 10:58:29 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/JAO/JaakkoSivill/pong/pong/pong/pong.cs
r2664 r2683 9 9 public class pong : PhysicsGame 10 10 { 11 PhysicsObject pallo; 12 13 14 11 15 public override void Begin() 12 16 { 13 // TODO: Kirjoita ohjelmakoodisi tähän14 17 LuoKentta(); 18 AloitaPeli(); 15 19 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 16 20 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 17 21 } 22 void LuoKentta() 23 { 24 pallo = new PhysicsObject(40.0, 40.0); 25 Add(pallo); 26 pallo.Shape = Shape.Circle; 27 pallo.X = -200.0; 28 pallo.Y = 0.0; 29 Vector impulssi = new Vector(500.0, 0.0); 30 pallo.Hit(impulssi); 31 Level.CreateBorders(); 32 pallo.Restitution = 1.0; 33 Level.BackgroundColor = Color.Black; 34 Camera.ZoomToLevel(); 35 PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 36 maila.Shape = Shape.Rectangle; 37 maila.X = Level.Left + 20.0; 38 maila.Y = 0.0; 39 maila.Restitution = 1.0; 40 Add(maila); 41 } 18 42 }
Note: See TracChangeset
for help on using the changeset viewer.