Changeset 3609
- Timestamp:
- 2012-07-05 15:06:44 (11 years ago)
- Location:
- 2012/27/NikoKa
- Files:
-
- 100 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/27/NikoKa/pong/pong/pong/pong.cs
r3454 r3609 9 9 public class pong : PhysicsGame 10 10 { 11 PhysicsObject spyro; 11 12 public override void Begin() 12 13 { 13 PhysicsObject spyro = new PhysicsObject(100,0);14 Add(spyro); 15 spyro.Shape = Shape.Diamond;16 spyro.Color = Color.Purple;17 Vector impulssi = new Vector(10000, 0);18 spyro.Hit(impulssi);19 Level.CreateBorders(1.0, false); 20 Level.BackgroundColor = Color.Black;21 spyro.Restitution = 1.0;14 luokenttä(); 15 16 aloitapeli(); 17 18 19 20 21 22 22 23 23 24 … … 29 30 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 30 31 } 32 void luokenttä() 33 34 { spyro = new PhysicsObject(90,90); 35 Add(spyro); 36 spyro.Shape = Shape.Circle; 37 spyro.Color = Color.Purple; 38 Level.CreateBorders(1.0, false); 39 Level.BackgroundColor = Color.Black; 40 spyro.Restitution = 1.0; 41 42 LuoMaila(Level.Left + 20.0, 0.0); 43 LuoMaila(Level.Right - 20.0, 0.0); 44 45 46 } 47 void aloitapeli() 48 { 49 Vector impulssi = new Vector(5000, 5000); 50 spyro.Hit(impulssi); 51 52 } 53 void LuoMaila(double x, double y) 54 { 55 PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 56 maila.Shape = Shape.Rectangle; 57 maila.X=x; 58 maila.Y=y; 59 maila.Restitution = 1.0; 60 Add(maila); 61 } 62 void AsetaOhjaimet() 63 { 64 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 65 } 66 67 68 31 69 } 32 70
Note: See TracChangeset
for help on using the changeset viewer.