Changeset 3498
- Timestamp:
- 2012-07-03 15:07:40 (11 years ago)
- Location:
- 2012/27/Alex
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/27/Alex/pong/pong/pong/pong.cs
r3453 r3498 9 9 public class pong : PhysicsGame 10 10 { 11 PhysicsObject takua; 11 12 public override void Begin() 12 13 { … … 15 16 LuoKentta(); 16 17 17 Vector impulssi = new Vector( 5000.0, 0.0);18 ony.Hit(impulssi);19 18 Vector impulssi = new Vector(1000.0, 0.0); 19 takua.Hit(impulssi); 20 20 21 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 21 22 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 22 23 }23 24 } 24 25 25 26 void LuoKentta() 26 27 { 27 PhysicsObject ony = new PhysicsObject(551.0, 5.0); 28 ony.Shape = Shape.Triangel; 29 ony.Color = Color.Blue; 30 ony.Y = 0.0; 31 ony.X = -200.0; 32 Add(ony); 28 takua = new PhysicsObject(50.0, 50.0); 29 takua.Shape = Shape.Circle; 30 takua.Color = Color.Red; 31 takua.Y = 0.0; 32 takua.X = -200.0; 33 Add(takua); 34 35 PhysicsObject makuta = PhysicsObject.CreateStaticObject(11.1, 77.7); 36 makuta.Shape = Shape.Circle; 37 makuta.Color = 38 makuta.X = Level.Left + 20.0; 39 makuta.Y = 0.0; 40 makuta.Restitution = 1.0; 41 Add(makuta); 42 33 43 Level.CreateBorders(1.0, false); 34 ony.Restitution = 1.0;44 takua.Restitution = 1.0; 35 45 Level.BackgroundColor = Color.Gray; 36 46
Note: See TracChangeset
for help on using the changeset viewer.