Changeset 5066
- Timestamp:
- 2014-06-24 14:54:31 (9 years ago)
- Location:
- 2014/26/TimoH
- Files:
-
- 50 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/26/TimoH/AutoPeli/AutoPeli/AutoPeli/AutoPeli.cs
r5045 r5066 9 9 public class AutoPeli : PhysicsGame 10 10 { 11 12 Vector[] reittiPisteet = new Vector[] 13 { 14 new Vector( -255.0, -124.0 ), 15 new Vector( -252.0, -131.0 ), 16 new Vector( -201.0, -214.0 ), 17 new Vector( -100.0, -214.0 ), 18 new Vector( 150.0, -214.0 ), 19 new Vector( 190.0, -190.0 ), 20 new Vector( 220.0, -170.0 ), 21 new Vector( 230.0, -150.0 ), 22 new Vector( 240.0, -100.0 ), 23 new Vector( 240.0, -50.0 ), 24 new Vector( 230.0, 0 ), 25 new Vector( 220.0, 0 ), 26 new Vector( -270, 0 ), 27 new Vector( -270, -50 ), 28 new Vector( -255, -124 ), 29 new Vector( -252, -131 ), 30 31 }; 32 33 34 Vector aloitusPaikka = new Vector(-255.0, -124.0); 35 36 Automobile auto; 37 Automobile vihuAuto; 38 11 39 public override void Begin() 12 40 { 13 41 LuoAlkuvalikko(); 14 15 42 } 16 43 17 44 void LuoAlkuvalikko() 18 45 { 19 MultiSelectWindow alkuValikko = new MultiSelectWindow("Pelin alkuvalikko", "Aloita peli", "Lopeta");46 MultiSelectWindow alkuValikko = new MultiSelectWindow("Pelin alkuvalikko", "Aloita peli", "Lopeta"); 20 47 Add(alkuValikko); 21 48 … … 27 54 { 28 55 LuoKentta(); 56 LuoAuto(); 57 LuoVihollinen(); 29 58 LisaaOhjaimet(); 30 59 } 31 60 32 61 void LuoKentta() 33 { 34 62 { 63 LuoRata(); 64 Level.CreateBorders(); 65 } 66 67 68 void LuoRata() 69 { 70 RoadMap tie = new RoadMap(reittiPisteet); 71 tie.DefaultWidth = 100.0; 72 tie.Insert(); 73 74 /* 75 foreach (Vector paikka in reittiPisteet) 76 { 77 LuoPallo(paikka); 78 } 79 */ 80 81 } 82 83 void LuoAuto() 84 { 85 auto = new Automobile(50, 50); 86 auto.Position = aloitusPaikka; 87 auto.Acceleration = 1000; 88 Add(auto); 89 } 90 91 92 void LuoPallo(Vector paikka) 93 { 94 PhysicsObject pallo = new PhysicsObject(10.0, 10.0); 95 pallo.Color = Color.Gold; 96 pallo.Position = paikka; 97 Add(pallo); 98 35 99 } 36 100 37 101 void LisaaOhjaimet() 38 102 { 103 Keyboard.Listen(Key.Up, ButtonState.Down, KiihdytaAutoa, "Kiihdyttää autoa"); 104 Keyboard.Listen(Key.Down, ButtonState.Down, HidastaAutoa, "hidastaa autoa"); 105 Keyboard.Listen(Key.Left, ButtonState.Down, KaannaAutoa, "kääntää autoa vasemmalle", 1); 106 Keyboard.Listen(Key.Right, ButtonState.Down,KaannaAutoa, "kääntää autoa oikealle", -1); 39 107 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 40 108 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 109 Keyboard.Listen(Key.R, ButtonState.Pressed, AloitaPeliAlusta, "Aloittaa alusta"); 110 } 111 112 113 void KiihdytaAutoa() 114 { 115 auto.Accelerate(); 116 } 117 118 void HidastaAutoa() 119 { 120 auto.Brake(); 121 } 122 123 void KaannaAutoa(int kulma) 124 { 125 auto.Turn(Angle.FromDegrees(kulma), 2); 126 } 127 128 void AloitaPeliAlusta() 129 { 130 ClearAll(); 131 AloitaPeli(); 132 } 133 134 void LuoVihollinen() 135 { 136 vihuAuto = new Automobile(200, 200); 137 vihuAuto.Position = new Vector(220.0, 0); 138 vihuAuto.Image = LoadImage("jonne"); 139 vihuAuto.Acceleration = 100; 140 Add(vihuAuto); 141 142 FollowerBrain seuraajanAivot = new FollowerBrain(auto); 143 seuraajanAivot.Speed = 100; 144 vihuAuto.Brain = seuraajanAivot; 41 145 } 42 146 } -
2014/26/TimoH/AutoPeli/AutoPeli/AutoPeli/obj/x86/Debug/AutoPeli.csproj.FileListAbsolute.txt
r5045 r5066 7 7 C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\obj\x86\Debug\AutoPeli.exe 8 8 C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\obj\x86\Debug\AutoPeli.pdb 9 C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\es.xnb 10 C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\images.xnb 11 C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\jonne.xnb -
2014/26/TimoH/AutoPeli/AutoPeli/AutoPeli/obj/x86/Debug/ContentPipeline-{731B0E0A-C994-42D7-8D80-D3EB50051D83}.xml
r5045 r5066 2 2 <XnaContent xmlns:Pipeline="Microsoft.Xna.Framework.Content.Pipeline"> 3 3 <Asset Type="Pipeline:BuildItemCollection"> 4 <Item> 5 <Source>es.jpg</Source> 6 <Name>es</Name> 7 <Importer>TextureImporter</Importer> 8 <Processor>TextureProcessor</Processor> 9 <Options>None</Options> 10 <Output>C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\es.xnb</Output> 11 <Time>2014-06-24T13:44:22.5350627+03:00</Time> 12 </Item> 13 <Item> 14 <Source>images.jpg</Source> 15 <Name>images</Name> 16 <Importer>TextureImporter</Importer> 17 <Processor>TextureProcessor</Processor> 18 <Options>None</Options> 19 <Output>C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\images.xnb</Output> 20 <Time>2014-06-24T13:51:00.5044542+03:00</Time> 21 </Item> 22 <Item> 23 <Source>jonne.png</Source> 24 <Name>jonne</Name> 25 <Importer>TextureImporter</Importer> 26 <Processor>TextureProcessor</Processor> 27 <Options>None</Options> 28 <Output>C:\MyTemp\TimoH\AutoPeli\AutoPeli\AutoPeli\bin\x86\Debug\Content\jonne.xnb</Output> 29 <Time>2014-06-24T13:56:22.8541166+03:00</Time> 30 </Item> 4 31 <BuildSuccessful>true</BuildSuccessful> 5 32 <Settings> … … 16 43 <Assemblies> 17 44 <Assembly> 45 <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 46 <Value>2013-09-06T09:39:14+03:00</Value> 47 </Assembly> 48 <Assembly> 49 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.XImporter.dll</Key> 50 <Value>2011-09-01T16:22:30+03:00</Value> 51 </Assembly> 52 <Assembly> 53 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll</Key> 54 <Value>2011-09-01T16:22:30+03:00</Value> 55 </Assembly> 56 <Assembly> 57 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll</Key> 58 <Value>2011-09-01T16:22:30+03:00</Value> 59 </Assembly> 60 <Assembly> 61 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll</Key> 62 <Value>2011-09-01T16:22:30+03:00</Value> 63 </Assembly> 64 <Assembly> 65 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll</Key> 66 <Value>2011-09-01T16:22:30+03:00</Value> 67 </Assembly> 68 <Assembly> 69 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.AudioImporters.dll</Key> 70 <Value>2011-09-01T16:22:30+03:00</Value> 71 </Assembly> 72 <Assembly> 73 <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\AnimationExtension.dll</Key> 74 <Value>2013-09-06T09:39:16+03:00</Value> 75 </Assembly> 76 <Assembly> 18 77 <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 19 78 <Value>2014-04-22T21:49:25.309997+03:00</Value> -
2014/26/TimoH/AutoPeli/AutoPeli/AutoPeliContent/AutoPeliContent.contentproj
r5045 r5066 45 45 <Reference Include="AnimationExtension" /> 46 46 </ItemGroup> 47 <ItemGroup> 48 <Compile Include="es.jpg"> 49 <Name>es</Name> 50 <Importer>TextureImporter</Importer> 51 <Processor>TextureProcessor</Processor> 52 </Compile> 53 </ItemGroup> 54 <ItemGroup> 55 <Compile Include="images.jpg"> 56 <Name>images</Name> 57 <Importer>TextureImporter</Importer> 58 <Processor>TextureProcessor</Processor> 59 </Compile> 60 </ItemGroup> 61 <ItemGroup> 62 <Compile Include="jonne.png"> 63 <Name>jonne</Name> 64 <Importer>TextureImporter</Importer> 65 <Processor>TextureProcessor</Processor> 66 </Compile> 67 </ItemGroup> 47 68 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 48 69 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2014/26/TimoH/toinen_pong_peli/toinen_pong_peli/toinen_pong_peli/obj/x86/Debug/toinen_pong_peli.csproj.FileListAbsolute.txt
r5045 r5066 6 6 C:\MyTemp\TimoH\toinen_pong_peli\toinen_pong_peli\toinen_pong_peli\obj\x86\Debug\toinen_pong_peli.exe 7 7 C:\MyTemp\TimoH\toinen_pong_peli\toinen_pong_peli\toinen_pong_peli\obj\x86\Debug\toinen_pong_peli.pdb 8 C:\MyTemp\TimoH\toinen_pong_peli\toinen_pong_peli\toinen_pong_peli\obj\x86\Debug\toinen_pong_peli.csprojResolveAssemblyReference.cache -
2014/26/TimoH/toinen_pong_peli/toinen_pong_peli/toinen_pong_peli/toinen_pong_peli.cs
r5045 r5066 34 34 void LuoKentta() 35 35 { 36 pallo = new PhysicsObject( 700.0, 700.0);36 pallo = new PhysicsObject(150150.0, 0.1); 37 37 pallo.Shape = Shape.Circle; 38 38 pallo.Color = Color.Gold;
Note: See TracChangeset
for help on using the changeset viewer.