Ignore:
Timestamp:
2015-06-23 08:37:57 (5 years ago)
Author:
sieerinn
Message:

Puukärry.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs

    r6151 r6156  
    3636    private Image groundTopImage = LoadImage("ground_top"); 
    3737 
     38    private Image cartImage = LoadImage("cart"); 
     39    private Image cartWheelImage = LoadImage("cartwheel"); 
     40 
    3841    public override void Begin() 
    3942    { 
     
    4750        cameraTimer.Timeout += UpdateCamera; 
    4851        cameraTimer.Start(); 
     52 
     53        // Testailen tässä kärryn luomista. 
     54        double size = 0.7; 
     55        PhysicsObject cart = new PhysicsObject(400 * size, 80 * size); 
     56        cart.X = -1600; 
     57        cart.Y = 200; 
     58        cart.Image = cartImage; 
     59        cart.CollisionIgnoreGroup = 2; 
     60        Add(cart); 
     61        PhysicsObject cartWheel = new PhysicsObject(160 * size, 160 * size, Shape.Circle); 
     62        cartWheel.Image = cartWheelImage; 
     63        cartWheel.Position = cart.Position + new Vector(-110, -30) * size; 
     64        cartWheel.CollisionIgnoreGroup = 2; 
     65        Add(cartWheel); 
     66        AxleJoint joint = new AxleJoint(cart, cartWheel); 
     67        Add(joint); 
    4968    } 
    5069 
Note: See TracChangeset for help on using the changeset viewer.