Changeset 8137 for 2016/30


Ignore:
Timestamp:
2016-07-27 11:29:08 (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

    r8134 r8137  
    1111 
    1212    Image tire = LoadImage("tire"); 
    13     PhysicsStructure tires = new PhysicsStructure(); 
     13    PhysicsStructure tires; 
    1414    public override void Begin() 
    1515 
    1616    { 
    1717 
     18        SmoothTextures = true; 
    1819        IsFullScreen = true; 
    1920 
    20         spawnTires(); 
    21         points(); 
    22         keys(); 
     21        SpawnTires(); 
     22        Points(); 
     23        Keys(); 
    2324         
    24  
    2525        Surface level = Surface.CreateBottom(Level, 30, 100, 10, 100); 
    2626        Add(level); 
    2727        Gravity = new Vector(0.0, -800.0); 
    2828 
    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); 
    3333         
    3434    } 
    3535 
    36     void spawnTires() 
     36    void SpawnTires() 
    3737    { 
    3838        PhysicsObject leftTire = new PhysicsObject(50.0, 50.0, Shape.Circle); 
     
    4242        rightTire.X = 65.0; 
    4343        rightTire.Y = -250.0; 
     44        leftTire.Image = tire; 
     45        rightTire.Image = tire; 
    4446        tires = new PhysicsStructure(leftTire, rightTire); 
    4547        Add(tires); 
    4648    } 
    47     void keys() 
     49    void Keys() 
    4850    { 
    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); 
    5355        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    5456    } 
    55     void movement(Vector movement) 
     57    void Movement(Vector movement) 
    5658    { 
    5759        tires.Push(movement); 
    5860    } 
    59     void angle(Vector angle) 
     61    void Angle(double ammount) 
    6062    { 
    61  
     63        tires.AngularVelocity = ammount; 
    6264    } 
    6365    IntMeter pointCounter; 
    64     void points() 
     66    void Points() 
    6567    { 
    6668        pointCounter = new IntMeter(0); 
Note: See TracChangeset for help on using the changeset viewer.