Changeset 2921
- Timestamp:
- 2012-06-11 15:00:23 (9 years ago)
- Location:
- 2012/24/ToniV/pong/pong/pong
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/24/ToniV/pong/pong/pong/pong.cs
r2911 r2921 13 13 { 14 14 LuoKentta(); 15 Vector impulssi = new Vector(500.0, 0.0); 16 pallo.Hit(impulssi); 15 16 Aloitapeli(); 17 17 18 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 18 19 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 19 20 20 21 } 21 22 void LuoKentta() 22 23 { 23 pallo = new PhysicsObject( 100.0, 100.0);24 pallo = new PhysicsObject(40.0, 40.0); 24 25 Add(pallo); 25 26 pallo.Shape = Shape.Circle; 26 27 pallo.Color = Color.Green; 27 28 29 LuoMaila( Level.Left +20.0,0.0); 30 LuoMaila(Level.Right - 20.0, 0.0); 31 28 32 pallo.X = -200.0; 29 33 pallo.Y = 0.0; 30 34 31 32 33 35 Level.CreateBorders(1.0, false); 34 36 pallo.Restitution = 1.0; 35 37 Level.BackgroundColor = Color.Yellow; 36 38 Camera.ZoomToLevel(); 37 PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0);38 maila.Shape = Shape.Rectangle;39 39 40 40 41 41 } 42 }43 42 43 void Aloitapeli() 44 { 45 Vector impulssi = new Vector(500.0, 0.0); 46 pallo.Hit(impulssi); 47 } 44 48 49 void LuoMaila(double x, double y) 50 { 51 PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 52 maila.Shape = Shape.Rectangle; 53 maila.X= x; 54 maila.Y= y; 55 maila.Restitution = 1.0; 56 maila.Color = Color.Violet; 57 Add(maila); 58 59 } 60 }
Note: See TracChangeset
for help on using the changeset viewer.