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

Puukärry.

Location:
2015/26/ohjaajat/HillbillyRun/HillbillyRun
Files:
2 added
3 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 
  • 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRunContent/HillbillyRunContent.contentproj

    r6151 r6156  
    6767    </Compile> 
    6868  </ItemGroup> 
     69  <ItemGroup> 
     70    <Compile Include="cart.png"> 
     71      <Name>cart</Name> 
     72      <Importer>TextureImporter</Importer> 
     73      <Processor>TextureProcessor</Processor> 
     74    </Compile> 
     75    <Compile Include="cartwheel.png"> 
     76      <Name>cartwheel</Name> 
     77      <Importer>TextureImporter</Importer> 
     78      <Processor>TextureProcessor</Processor> 
     79    </Compile> 
     80  </ItemGroup> 
    6981  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    7082  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
Note: See TracChangeset for help on using the changeset viewer.