Changeset 8137 for 2016/30/AleksiN
- Timestamp:
- 2016-07-27 11:29:08 (7 years ago)
- Location:
- 2016/30/AleksiN/name
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/30/AleksiN/name/name/name/name.cs
r8134 r8137 11 11 12 12 Image tire = LoadImage("tire"); 13 PhysicsStructure tires = new PhysicsStructure();13 PhysicsStructure tires; 14 14 public override void Begin() 15 15 16 16 { 17 17 18 SmoothTextures = true; 18 19 IsFullScreen = true; 19 20 20 spawnTires();21 points();22 keys();21 SpawnTires(); 22 Points(); 23 Keys(); 23 24 24 25 25 Surface level = Surface.CreateBottom(Level, 30, 100, 10, 100); 26 26 Add(level); 27 27 Gravity = new Vector(0.0, -800.0); 28 28 29 Wind = new Vector(-25, 0);30 Smoke smoke = new Smoke();31 smoke.Position = tires.Position;32 Add(smoke);29 //Wind = new Vector(-25, 0); 30 //Smoke smoke = new Smoke(); 31 //smoke.Position = tires.Position; 32 //Add(smoke); 33 33 34 34 } 35 35 36 void spawnTires()36 void SpawnTires() 37 37 { 38 38 PhysicsObject leftTire = new PhysicsObject(50.0, 50.0, Shape.Circle); … … 42 42 rightTire.X = 65.0; 43 43 rightTire.Y = -250.0; 44 leftTire.Image = tire; 45 rightTire.Image = tire; 44 46 tires = new PhysicsStructure(leftTire, rightTire); 45 47 Add(tires); 46 48 } 47 void keys()49 void Keys() 48 50 { 49 Keyboard.Listen(Key. Left, ButtonState.Down, movement, null, new Vector(-2000, 0));50 Keyboard.Listen(Key. Right, ButtonState.Down, movement, null, new Vector(2000, 0));51 Keyboard.Listen(Key. Up, ButtonState.Down, angle, null, new Vector(-500, 0));52 Keyboard.Listen(Key. Down, ButtonState.Down, angle, null, new Vector(500, 0));51 Keyboard.Listen(Key.Down, ButtonState.Down, Movement, null, new Vector(-2000, 0)); 52 Keyboard.Listen(Key.Up, ButtonState.Down, Movement, null, new Vector(2000, 0)); 53 Keyboard.Listen(Key.Left, ButtonState.Down, Angle, null, 10.0); 54 Keyboard.Listen(Key.Right, ButtonState.Down, Angle, null, -10.0); 53 55 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 54 56 } 55 void movement(Vector movement)57 void Movement(Vector movement) 56 58 { 57 59 tires.Push(movement); 58 60 } 59 void angle(Vector angle)61 void Angle(double ammount) 60 62 { 61 63 tires.AngularVelocity = ammount; 62 64 } 63 65 IntMeter pointCounter; 64 void points()66 void Points() 65 67 { 66 68 pointCounter = new IntMeter(0);
Note: See TracChangeset
for help on using the changeset viewer.