- Timestamp:
- 2014-06-27 11:51:15 (8 years ago)
- Location:
- 2014/26/TimoH
- Files:
-
- 13 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/26/TimoH/AutoPeli/AutoPeli/AutoPeli/AutoPeli.cs
r5087 r5151 31 31 }; 32 32 33 List<String> taustaMusiikit = new List<string>() { "es-song", "burnout_paradise" }; 34 int seuraava = 0; 33 35 34 36 Vector aloitusPaikka = new Vector(-255.0, -124.0); 35 37 36 38 Automobile auto; 37 Automobile vihuAuto;39 // Automobile vihuAuto; 38 40 39 41 public override void Begin() … … 53 55 void AloitaPeli() 54 56 { 57 seuraava = 0; 55 58 LuoKentta(); 56 59 LuoAuto(); 57 auto.Image = LoadImage("jonne");60 //auto.Image = LoadImage("jonne"); 58 61 59 LuoVihollinen(); 62 //LuoVihollinen(); 63 LuoMusiikki(); 60 64 LisaaOhjaimet(); 65 LisaaOhjain(); 61 66 } 62 67 … … 83 88 } 84 89 90 void LuoMusiikki() 91 { 92 MediaPlayer.Play("es-song"); 93 seuraava = 1; 94 Timer soittoTarkistin = new Timer(); 95 soittoTarkistin.Interval = 2; 96 soittoTarkistin.Timeout += delegate { if (!MediaPlayer.IsPlaying) { MediaPlayer.Play(taustaMusiikit[seuraava].ToString()); seuraava++; } }; 97 soittoTarkistin.Start(); 98 } 99 85 100 void LuoAuto() 86 101 { 87 102 auto = new Automobile(100, 100); 88 103 auto.Position = aloitusPaikka; 89 auto.Acceleration = 1000; 104 auto.Acceleration = 500; 105 auto.Image = LoadImage("download1"); 106 auto.BrakeDeceleration = 500; 107 auto.Restitution = 0.1; 108 auto.AngularDamping = 0.5; 90 109 Add(auto); 91 110 } … … 112 131 } 113 132 133 void LisaaOhjain() 134 { 135 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, KaannaAutoa, "kääntää autoa vasemmalle", 1); 136 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, KaannaAutoa, "kääntää autoa oikealle", -1); 137 ControllerOne.ListenAnalog(AnalogControl.RightTrigger, 0.1, KaasutaAutolla, "kiihdytä autoa"); 138 ControllerOne.ListenAnalog(AnalogControl.LeftTrigger, 0.1 , JarrutaAutolla, "hidastaa autoa"); 139 140 } 141 142 void JarrutaAutolla(AnalogState liipasimentila) 143 { 144 HidastaAutoa(); 145 } 146 147 void KaasutaAutolla(AnalogState liipasimenTila) 148 { 149 KiihdytaAutoa(); 150 } 114 151 115 152 void KiihdytaAutoa() … … 131 168 { 132 169 ClearAll(); 170 133 171 AloitaPeli(); 134 172 } 135 173 136 void LuoVihollinen()137 {138 vihuAuto = new Automobile(50, 100);139 vihuAuto.Position = new Vector(220.0, 0);140 vihuAuto.Image = LoadImage("es");141 vihuAuto.Acceleration = 100;142 Add(vihuAuto);174 //void LuoVihollinen() 175 //{ 176 // vihuAuto = new Automobile(50, 100); 177 //vihuAuto.Position = new Vector(220.0, 0); 178 //vihuAuto.Image = LoadImage("es"); 179 //vihuAuto.Acceleration = 100; 180 //Add(vihuAuto); 143 181 144 FollowerBrain seuraajanAivot = new FollowerBrain(auto);145 seuraajanAivot.Speed = 100;146 vihuAuto.Brain = seuraajanAivot;147 }182 //FollowerBrain seuraajanAivot = new FollowerBrain(auto); 183 //seuraajanAivot.Speed = 100; 184 //vihuAuto.Brain = seuraajanAivot; 185 //} 148 186 } -
2014/26/TimoH/AutoPeli/AutoPeli/AutoPeli/AutoPeli.csproj.Debug.cachefile
r5087 r5151 3 3 Content\jonne.xnb 4 4 Content\graycat.xnb 5 Content\download1.xnb 6 Content\burnout_paradise.xnb 7 Content\es-song.xnb 8 Content\burnout_paradise.wma 9 Content\es-song.wma -
2014/26/TimoH/AutoPeli/AutoPeli/AutoPeli/obj/x86/Debug/AutoPeli.csproj.FileListAbsolute.txt
r5087 r5151 11 11 C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\jonne.xnb 12 12 C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\graycat.xnb 13 C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\download1.xnb 14 C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\burnout_paradise.xnb 15 C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\burnout_paradise.wma 16 C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\es-song.xnb 17 C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\es-song.wma -
2014/26/TimoH/AutoPeli/AutoPeli/AutoPeli/obj/x86/Debug/ContentPipeline-{731B0E0A-C994-42D7-8D80-D3EB50051D83}.xml
r5087 r5151 37 37 <Output>C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\graycat.xnb</Output> 38 38 <Time>2014-06-25T09:14:14.560898+03:00</Time> 39 </Item> 40 <Item> 41 <Source>download1.png</Source> 42 <Name>download1</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\download1.xnb</Output> 47 <Time>2014-06-27T09:36:22.6423159+03:00</Time> 48 </Item> 49 <Item> 50 <Source>burnout_paradise.mp3</Source> 51 <Name>burnout_paradise</Name> 52 <Importer>Mp3Importer</Importer> 53 <Processor>SongProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\burnout_paradise.xnb</Output> 56 <Extra>C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\burnout_paradise.wma</Extra> 57 <Time>2014-06-27T10:17:12.5349818+03:00</Time> 58 </Item> 59 <Item> 60 <Source>es-song.mp3</Source> 61 <Name>es-song</Name> 62 <Importer>Mp3Importer</Importer> 63 <Processor>SongProcessor</Processor> 64 <Options>None</Options> 65 <Output>C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\es-song.xnb</Output> 66 <Extra>C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\es-song.wma</Extra> 67 <Time>2014-06-27T10:32:34.9252116+03:00</Time> 39 68 </Item> 40 69 <BuildSuccessful>true</BuildSuccessful> -
2014/26/TimoH/AutoPeli/AutoPeli/AutoPeli/obj/x86/Debug/cachefile-{731B0E0A-C994-42D7-8D80-D3EB50051D83}-targetpath.txt
r5087 r5151 3 3 Content\jonne.xnb 4 4 Content\graycat.xnb 5 Content\download1.xnb 6 Content\burnout_paradise.xnb 7 Content\burnout_paradise.wma 8 Content\es-song.xnb 9 Content\es-song.wma -
2014/26/TimoH/AutoPeli/AutoPeli/AutoPeliContent/AutoPeliContent.contentproj
r5087 r5151 73 73 </Compile> 74 74 </ItemGroup> 75 <ItemGroup> 76 <Compile Include="download1.png"> 77 <Name>download1</Name> 78 <Importer>TextureImporter</Importer> 79 <Processor>TextureProcessor</Processor> 80 </Compile> 81 </ItemGroup> 82 <ItemGroup> 83 <Compile Include="burnout_paradise.mp3"> 84 <Name>burnout_paradise</Name> 85 <Importer>Mp3Importer</Importer> 86 <Processor>SongProcessor</Processor> 87 </Compile> 88 </ItemGroup> 89 <ItemGroup> 90 <Compile Include="es-song.mp3"> 91 <Name>es-song</Name> 92 <Importer>Mp3Importer</Importer> 93 <Processor>SongProcessor</Processor> 94 </Compile> 95 </ItemGroup> 75 96 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 76 97 <!-- 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.