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