Changeset 5094


Ignore:
Timestamp:
2014-06-25 11:06:58 (5 years ago)
Author:
pypelli
Message:
 
Location:
2014/26/Pyry-PetteriP
Files:
4 added
11 edited

Legend:

Unmodified
Added
Removed
  • 2014/26/Pyry-PetteriP/Motopeli/Motopeli/Motopeli/Motopeli.cs

    r5074 r5094  
    99public class Motopeli : PhysicsGame 
    1010{ 
    11     Image autoKuva = LoadImage("auto"); 
     11    Image autoKuva = LoadImage("auto2"); 
    1212    Automobile moottoripyora; 
    1313 
    1414    Vector[] reittiPisteet = new Vector[] 
    15 {   new Vector( -255.0, -124.0 ), 
    16     new Vector( -252.0, -131.0 ), 
    17     new Vector( -201.0, -214.0 ), 
     15{   new Vector( 600.0, -400.0 ), 
     16    new Vector( -300.0, 400.0 ), 
     17    new Vector( -.400, -214.0 ), 
     18   // new Vector(- ), 
     19   // new Vector(  ), 
     20   
    1821 
    19  
    20  
    21  
    22 };   
     22}; 
    2323 
    2424 
     
    3838    { 
    3939        RoadMap tie = new RoadMap(reittiPisteet); 
    40         tie.DefaultWidth = 200.0; 
     40        tie.DefaultWidth = 150.0; 
    4141        tie.Insert(); 
     42        Level.BackgroundColor = Color.Green; 
    4243 
     44        foreach (Vector paikka in reittiPisteet) 
     45        { 
     46            LuoMerkki(paikka); 
    4347 
    44  
     48        } 
    4549    } 
    4650 
     
    4852    void Moottoripyora() 
    4953    { 
    50         moottoripyora = new Automobile(55.0, 55.0); 
     54        moottoripyora = new Automobile(40.0, 25.0); 
    5155        Add(moottoripyora); 
    5256        moottoripyora.Image = autoKuva; 
     57        moottoripyora.AngularDamping = 0.95; 
     58        //moottoripyora.MomentOfInertia = 400; 
     59 
    5360    } 
    5461 
     
    5663    void AsetaOhjaimet() 
    5764    { 
    58         Keyboard.Listen(Key.Left, ButtonState.Down, KaannaPelaajaa, null, Angle.FromDegrees(-1)); 
    59         Keyboard.Listen(Key.Right, ButtonState.Down, KaannaPelaajaa, null, Angle.FromDegrees(1)); 
     65        Keyboard.Listen(Key.Right, ButtonState.Down, KaannaPelaajaa, null, -1000.0); 
     66        Keyboard.Listen(Key.Left, ButtonState.Down, KaannaPelaajaa, null, 1000.0); 
    6067        Keyboard.Listen(Key.Up, ButtonState.Down, KaasutaPelaajaa, null); 
    6168        Keyboard.Listen(Key.Down, ButtonState.Down, TaaksepainPelaajaa, null); 
     
    6976        moottoripyora.Push(vektori); 
    7077    } 
    71     void KaannaPelaajaa(Angle kulma) 
     78    void KaannaPelaajaa(double kulma) 
    7279    { 
    73         moottoripyora.Angle += kulma; 
    74  
    75  
     80        //moottoripyora.Angle += kulma; 
     81        moottoripyora.ApplyTorque(kulma); 
    7682    } 
    7783 
     
    8490        moottoripyora.Brake(); 
    8591    } 
     92    void LuoMerkki(Vector paikka) 
     93    { 
     94        PhysicsObject palikka = new PhysicsObject(10.0, 10.0); 
     95        Add(palikka); 
     96        palikka.Position = paikka; 
     97        palikka.Color = Color.Black; 
     98 
     99    } 
     100 
     101    void AloitaAlusta() 
     102    { 
     103        ClearAll(); 
     104    } 
     105 
     106   
    86107} 
    87108    
  • 2014/26/Pyry-PetteriP/Motopeli/Motopeli/Motopeli/Motopeli.csproj.Debug.cachefile

    r5074 r5094  
    11Content\auto.xnb 
     2Content\auto2.xnb 
  • 2014/26/Pyry-PetteriP/Motopeli/Motopeli/Motopeli/obj/x86/Debug/ContentPipeline-{49BD7CC0-449A-44E6-A07A-3F90AE280C94}.xml

    r5074 r5094  
    1010      <Output>C:\MyTemp\Pyry-PetteriP\Motopeli\Motopeli\Motopeli\bin\x86\Debug\Content\auto.xnb</Output> 
    1111      <Time>2014-06-24T14:30:54.1764027+03:00</Time> 
     12    </Item> 
     13    <Item> 
     14      <Source>auto2.png</Source> 
     15      <Name>auto2</Name> 
     16      <Importer>TextureImporter</Importer> 
     17      <Processor>TextureProcessor</Processor> 
     18      <Options>None</Options> 
     19      <Output>C:\MyTemp\Pyry-PetteriP\Motopeli\Motopeli\Motopeli\bin\x86\Debug\Content\auto2.xnb</Output> 
     20      <Time>2014-06-25T10:15:52.0418827+03:00</Time> 
    1221    </Item> 
    1322    <BuildSuccessful>true</BuildSuccessful> 
  • 2014/26/Pyry-PetteriP/Motopeli/Motopeli/Motopeli/obj/x86/Debug/Motopeli.csproj.FileListAbsolute.txt

    r5074 r5094  
    88C:\MyTemp\Pyry-PetteriP\Motopeli\Motopeli\Motopeli\obj\x86\Debug\Motopeli.pdb 
    99C:\MyTemp\Pyry-PetteriP\Motopeli\Motopeli\Motopeli\bin\x86\Debug\Content\auto.xnb 
     10C:\MyTemp\Pyry-PetteriP\Motopeli\Motopeli\Motopeli\bin\x86\Debug\Content\auto2.xnb 
  • 2014/26/Pyry-PetteriP/Motopeli/Motopeli/Motopeli/obj/x86/Debug/cachefile-{49BD7CC0-449A-44E6-A07A-3F90AE280C94}-targetpath.txt

    r5074 r5094  
    11Content\auto.xnb 
     2Content\auto2.xnb 
  • 2014/26/Pyry-PetteriP/Motopeli/Motopeli/MotopeliContent/MotopeliContent.contentproj

    r5074 r5094  
    5252    </Compile> 
    5353  </ItemGroup> 
     54  <ItemGroup> 
     55    <Compile Include="auto2.png"> 
     56      <Name>auto2</Name> 
     57      <Importer>TextureImporter</Importer> 
     58      <Processor>TextureProcessor</Processor> 
     59    </Compile> 
     60  </ItemGroup> 
    5461  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    5562  <!--  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.