Ignore:
Timestamp:
2016-07-27 12:14:52 (4 years ago)
Author:
almajono
Message:
 
File:
1 edited

Legend:

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

    r8137 r8145  
    99public class name : PhysicsGame 
    1010{ 
    11  
     11    Image motorbike = LoadImage("motorbike"); 
    1212    Image tire = LoadImage("tire"); 
    1313    PhysicsStructure tires; 
     
    1919        IsFullScreen = true; 
    2020 
    21         SpawnTires(); 
     21        AddTires(); 
    2222        Points(); 
    2323        Keys(); 
     
    3131        //smoke.Position = tires.Position; 
    3232        //Add(smoke); 
    33          
     33 
     34        PhysicsObject bike = new PhysicsObject(250.0, 250.0); 
     35        bike.Image = motorbike; 
     36        Add(bike); 
     37        bike.IgnoresCollisionResponse = true; 
     38 
    3439    } 
    3540 
    36     void SpawnTires() 
     41    void AddTires() 
    3742    { 
    3843        PhysicsObject leftTire = new PhysicsObject(50.0, 50.0, Shape.Circle); 
     
    4954    void Keys() 
    5055    { 
    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); 
     56        Keyboard.Listen(Key.Down, ButtonState.Down, Movement, null, new Vector(-1000, 0)); 
     57        Keyboard.Listen(Key.Up, ButtonState.Down, Movement, null, new Vector(1000, 0)); 
     58        Keyboard.Listen(Key.Left, ButtonState.Down, ChangeAngle, null, 7.5); 
     59        Keyboard.Listen(Key.Right, ButtonState.Down, ChangeAngle, null, -7.5); 
    5560        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    5661    } 
     
    5964        tires.Push(movement); 
    6065    } 
    61     void Angle(double ammount) 
     66    void ChangeAngle(double ammount) 
    6267    { 
    6368        tires.AngularVelocity = ammount; 
Note: See TracChangeset for help on using the changeset viewer.