Changeset 8115


Ignore:
Timestamp:
2016-07-26 14:51:10 (3 years ago)
Author:
almajono
Message:
 
Location:
2016/30/AleksiN/name
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 2016/30/AleksiN/name/name/name/name.cs

    r8109 r8115  
    99public class name : PhysicsGame 
    1010{ 
     11    PhysicsStructure tires = new PhysicsStructure(); 
    1112    public override void Begin() 
    1213    { 
     14       points(); 
     15 
    1316        Surface level = Surface.CreateBottom(Level, 30, 100, 10, 100); 
    1417        Add(level); 
     
    1922        PhysicsObject rightTire = new PhysicsObject(50.0, 50.0, Shape.Circle); 
    2023        leftTire.X = -65.0; 
    21         leftTire.Y = 0.0; 
     24        leftTire.Y = -250.0; 
    2225        rightTire.X = 65.0; 
    23         rightTire.Y = 0.0; 
    24         PhysicsStructure tires = new PhysicsStructure(leftTire, rightTire); 
     26        rightTire.Y = -250.0; 
     27        tires = new PhysicsStructure(leftTire, rightTire); 
    2528        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)); 
    2634 
    2735        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    2836    } 
    2937 
     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 
    3062} 
Note: See TracChangeset for help on using the changeset viewer.