- Timestamp:
- 2014-06-25 11:06:58 (8 years ago)
- 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 9 9 public class Motopeli : PhysicsGame 10 10 { 11 Image autoKuva = LoadImage("auto ");11 Image autoKuva = LoadImage("auto2"); 12 12 Automobile moottoripyora; 13 13 14 14 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 18 21 19 20 21 22 }; 22 }; 23 23 24 24 … … 38 38 { 39 39 RoadMap tie = new RoadMap(reittiPisteet); 40 tie.DefaultWidth = 200.0;40 tie.DefaultWidth = 150.0; 41 41 tie.Insert(); 42 Level.BackgroundColor = Color.Green; 42 43 44 foreach (Vector paikka in reittiPisteet) 45 { 46 LuoMerkki(paikka); 43 47 44 48 } 45 49 } 46 50 … … 48 52 void Moottoripyora() 49 53 { 50 moottoripyora = new Automobile( 55.0, 55.0);54 moottoripyora = new Automobile(40.0, 25.0); 51 55 Add(moottoripyora); 52 56 moottoripyora.Image = autoKuva; 57 moottoripyora.AngularDamping = 0.95; 58 //moottoripyora.MomentOfInertia = 400; 59 53 60 } 54 61 … … 56 63 void AsetaOhjaimet() 57 64 { 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); 60 67 Keyboard.Listen(Key.Up, ButtonState.Down, KaasutaPelaajaa, null); 61 68 Keyboard.Listen(Key.Down, ButtonState.Down, TaaksepainPelaajaa, null); … … 69 76 moottoripyora.Push(vektori); 70 77 } 71 void KaannaPelaajaa( Angle kulma)78 void KaannaPelaajaa(double kulma) 72 79 { 73 moottoripyora.Angle += kulma; 74 75 80 //moottoripyora.Angle += kulma; 81 moottoripyora.ApplyTorque(kulma); 76 82 } 77 83 … … 84 90 moottoripyora.Brake(); 85 91 } 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 86 107 } 87 108 -
2014/26/Pyry-PetteriP/Motopeli/Motopeli/Motopeli/Motopeli.csproj.Debug.cachefile
r5074 r5094 1 1 Content\auto.xnb 2 Content\auto2.xnb -
2014/26/Pyry-PetteriP/Motopeli/Motopeli/Motopeli/obj/x86/Debug/ContentPipeline-{49BD7CC0-449A-44E6-A07A-3F90AE280C94}.xml
r5074 r5094 10 10 <Output>C:\MyTemp\Pyry-PetteriP\Motopeli\Motopeli\Motopeli\bin\x86\Debug\Content\auto.xnb</Output> 11 11 <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> 12 21 </Item> 13 22 <BuildSuccessful>true</BuildSuccessful> -
2014/26/Pyry-PetteriP/Motopeli/Motopeli/Motopeli/obj/x86/Debug/Motopeli.csproj.FileListAbsolute.txt
r5074 r5094 8 8 C:\MyTemp\Pyry-PetteriP\Motopeli\Motopeli\Motopeli\obj\x86\Debug\Motopeli.pdb 9 9 C:\MyTemp\Pyry-PetteriP\Motopeli\Motopeli\Motopeli\bin\x86\Debug\Content\auto.xnb 10 C:\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 1 1 Content\auto.xnb 2 Content\auto2.xnb -
2014/26/Pyry-PetteriP/Motopeli/Motopeli/MotopeliContent/MotopeliContent.contentproj
r5074 r5094 52 52 </Compile> 53 53 </ItemGroup> 54 <ItemGroup> 55 <Compile Include="auto2.png"> 56 <Name>auto2</Name> 57 <Importer>TextureImporter</Importer> 58 <Processor>TextureProcessor</Processor> 59 </Compile> 60 </ItemGroup> 54 61 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 55 62 <!-- 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.