Changeset 1354 for 2010/30/alkivima/Car Duels/Peli.cs
- Timestamp:
- 2010-07-28 11:29:51 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/30/alkivima/Car Duels/Peli.cs
r1330 r1354 7 7 public class Peli : TopDownPhysicsGame 8 8 { 9 PhysicsObject vasenReuna; 10 PhysicsObject oikeaReuna; 11 9 12 protected override void Begin() 10 13 { 11 KineticFriction = 1.0; // Asetetaan kitka14 KineticFriction = 0.5; // Asetetaan kitka 12 15 13 Automobile auto = new Automobile( 80, 40);16 Automobile auto = new Automobile(60, 50); 14 17 auto.Mass = 100.0; 15 18 auto.Color = new Color(1, 1, 1); 19 auto.X = -200; 20 auto.Y = 0; 21 auto.LinearDamping = 0.99; 22 auto.AngularDamping = 1.0; 16 23 Add(auto); 17 24 18 Automobile auto2 = new Automobile( 80, 40);25 Automobile auto2 = new Automobile(60, 50); 19 26 auto2.Mass = 100.0; 20 27 auto2.Color = new Color(255, 255, 255); 28 auto2.X = 200; 29 auto2.Y = 0; 30 auto2.LinearDamping = 0.99; 31 auto2.AngularDamping = 1.0; 32 auto2.Angle = Angle.Degrees (180.0); 21 33 Add(auto2); 22 34 … … 57 69 void Kentta() 58 70 { 71 PhysicsObject pylvas1 = PhysicsObject.CreateStaticObject(50.0, 50.0); 72 pylvas1.Shape = Shapes.Rectangle; 73 pylvas1.X = 200; 74 pylvas1.Y = 200; 75 pylvas1.Restitution = 0.2; 76 pylvas1.Tag = "pylvas"; 77 Add(pylvas1); 78 79 PhysicsObject pylvas2 = PhysicsObject.CreateStaticObject(50.0, 50.0); 80 pylvas2.Shape = Shapes.Rectangle; 81 pylvas2.X = -200; 82 pylvas2.Y = 200; 83 pylvas2.Restitution = 0.2; 84 pylvas2.Tag = "pylvas"; 85 Add(pylvas2); 86 87 PhysicsObject pylvas3 = PhysicsObject.CreateStaticObject(50.0, 50.0); 88 pylvas3.Shape = Shapes.Rectangle; 89 pylvas3.X = -200; 90 pylvas3.Y = -200; 91 pylvas3.Restitution = 0.2; 92 pylvas3.Tag = "pylvas"; 93 Add(pylvas3); 94 95 PhysicsObject pylvas4 = PhysicsObject.CreateStaticObject(50.0, 50.0); 96 pylvas4.Shape = Shapes.Rectangle; 97 pylvas4.X = 200; 98 pylvas4.Y = -200; 99 pylvas4.Restitution = 0.2; 100 pylvas4.Tag = "pylvas"; 101 Add(pylvas4); 102 103 GameObject maata = new GameObject(800.0, 700.0); 104 maata.Shape = Shapes.Circle; 105 maata.Color = Color.Gray; 106 Add(maata); 107 108 GameObject Reuna = new GameObject(70.0, 70.0); 109 Reuna.Shape = Shapes.Circle; 110 Reuna.Color = Color.Black; 111 Add(Reuna); 112 113 GameObject Boostipaikka = new GameObject(60.0, 60.0); 114 Boostipaikka.Shape = Shapes.Circle; 115 Boostipaikka.Color = Color.Turquoise; 116 Add(Boostipaikka); 117 118 119 vasenReuna = Level.CreateLeftBorder(); 120 vasenReuna.Restitution = 0.3; 121 vasenReuna.IsVisible = true; 122 oikeaReuna = Level.CreateRightBorder(); 123 oikeaReuna.Restitution = 0.3; 124 oikeaReuna.IsVisible = true; 125 PhysicsObject ylaReuna = Level.CreateTopBorder(); 126 ylaReuna.Restitution = 0.3; 127 ylaReuna.IsVisible = true; 128 PhysicsObject alaReuna = Level.CreateBottomBorder(); 129 alaReuna.Restitution = 0.3; 130 alaReuna.IsVisible = true; 131 59 132 Level.BackgroundColor = Color.ForestGreen; 133 134 Camera.X = 0.0; 135 Camera.Y = 0.0; 136 Camera.Zoom(1.2); 137 60 138 } 139 void PylvaidenVarit() 140 { 141 142 } 143 61 144 }
Note: See TracChangeset
for help on using the changeset viewer.