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