Changeset 8115
- Timestamp:
- 2016-07-26 14:51:10 (7 years ago)
- Location:
- 2016/30/AleksiN/name
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/30/AleksiN/name/name/name/name.cs
r8109 r8115 9 9 public class name : PhysicsGame 10 10 { 11 PhysicsStructure tires = new PhysicsStructure(); 11 12 public override void Begin() 12 13 { 14 points(); 15 13 16 Surface level = Surface.CreateBottom(Level, 30, 100, 10, 100); 14 17 Add(level); … … 19 22 PhysicsObject rightTire = new PhysicsObject(50.0, 50.0, Shape.Circle); 20 23 leftTire.X = -65.0; 21 leftTire.Y = 0.0;24 leftTire.Y = -250.0; 22 25 rightTire.X = 65.0; 23 rightTire.Y = 0.0;24 PhysicsStructuretires = new PhysicsStructure(leftTire, rightTire);26 rightTire.Y = -250.0; 27 tires = new PhysicsStructure(leftTire, rightTire); 25 28 Add(tires); 29 30 Keyboard.Listen(Key.Left, ButtonState.Down, movement, null, new Vector(-2000, 0)); 31 Keyboard.Listen(Key.Right, ButtonState.Down, movement, null, new Vector(2000, 0)); 32 Keyboard.Listen(Key.Up, ButtonState.Down, angle, null, new Vector(-500, 0)); 33 Keyboard.Listen(Key.Down, ButtonState.Down, angle, null, new Vector(500, 0)); 26 34 27 35 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 28 36 } 29 37 38 void movement(Vector movement) 39 { 40 tires.Push(movement); 41 } 42 43 void angle(Vector angle) 44 { 45 46 } 47 48 IntMeter pointCounter; 49 50 void points() 51 { 52 pointCounter = new IntMeter(0); 53 Label pointLabel = new Label(); 54 pointLabel.X = Screen.Left + 100; 55 pointLabel.Y = Screen.Top - 100; 56 pointLabel.TextColor = Color.Black; 57 pointLabel.Color = Color.White; 58 pointLabel.BindTo(pointCounter); 59 Add(pointLabel); 60 } 61 30 62 }
Note: See TracChangeset
for help on using the changeset viewer.