Changeset 8155 for 2016/30


Ignore:
Timestamp:
2016-07-27 13:54:11 (3 years ago)
Author:
almajono
Message:
 
Location:
2016/30/AleksiN/name/name/name
Files:
5 edited

Legend:

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

    r8154 r8155  
    99public class name : PhysicsGame 
    1010{ 
     11 
    1112    Image motorbike = LoadImage("motorbike"); 
    1213    Image tire = LoadImage("tire"); 
    13     PhysicsStructure tires; 
     14    PhysicsStructure bike; 
    1415    public override void Begin() 
    1516 
     
    1920        IsFullScreen = true; 
    2021 
    21         AddTires(); 
     22        AddPlayer(); 
    2223        Points(); 
    2324        Keys(); 
     
    2728        Gravity = new Vector(0.0, -800.0); 
    2829 
    29         //Wind = new Vector(-25, 0); 
    30         //Smoke smoke = new Smoke(); 
    31         //smoke.Position = tires.Position; 
    32         //Add(smoke); 
     30        Wind = new Vector(-25, 0); 
     31        Smoke smoke = new Smoke(); 
     32        smoke.Position = bike.Position; 
     33        Add(smoke); 
    3334 
    3435    } 
    3536 
    36     void AddTires() 
     37    void AddPlayer() 
    3738    { 
    38         PhysicsObject leftTire = new PhysicsObject(50.0, 50.0, Shape.Circle); 
    39         PhysicsObject rightTire = new PhysicsObject(50.0, 50.0, Shape.Circle); 
    40         PhysicsObject bike = new PhysicsObject(200.0, 200.0); 
    41         leftTire.X = -65.0; 
    42         leftTire.Y = -250.0; 
     39        PhysicsObject leftTire = new PhysicsObject(57.5, 57.5, Shape.Circle); 
     40        PhysicsObject rightTire = new PhysicsObject(57.5, 57.5, Shape.Circle); 
     41        PhysicsObject bike = new PhysicsObject(250.0, 200.0); 
     42        leftTire.X = -70.0; 
     43        leftTire.Y = -260.0; 
    4344        rightTire.X = 65.0; 
    44         rightTire.Y = -250.0; 
     45        rightTire.Y = -260.0; 
    4546        bike.X = 0; 
    4647        bike.Y = -200; 
     
    4849        rightTire.Image = tire; 
    4950        bike.Image = motorbike; 
    50         tires = new PhysicsStructure(leftTire, rightTire, bike); 
     51        this.bike = new PhysicsStructure(leftTire, rightTire, bike); 
    5152        bike.IgnoresCollisionResponse = true; 
    52         Add(tires); 
     53        Add(this.bike); 
    5354        Add(bike); 
    5455    } 
     
    6364    void Movement(Vector movement) 
    6465    { 
    65         tires.Push(movement); 
     66        bike.Push(movement); 
    6667    } 
    6768    void ChangeAngle(double ammount) 
    6869    { 
    69         tires.AngularVelocity = ammount; 
     70        bike.AngularVelocity = ammount; 
    7071    } 
    7172    IntMeter pointCounter; 
Note: See TracChangeset for help on using the changeset viewer.