Changeset 6979 for 2015/30/EliasHy
- Timestamp:
- 2015-07-23 14:31:00 (8 years ago)
- Location:
- 2015/30/EliasHy/SpaceAdventure/SpaceAdventure
- Files:
-
- 3 added
- 1 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/SpaceAdventure.cs
r6976 r6979 22 22 23 23 IntMeter pistelaskuri; 24 IntMeter voittoLaskuri = new IntMeter(0, 0, 0); 24 25 DoubleMeter elamaLaskuri; 25 26 … … 62 63 Keyboard.Listen(Key.R, ButtonState.Pressed, AloitaPeli, "Aloita peli alusta"); 63 64 LuoPistelaskuri(); 65 66 LuoVoittoLaskuri(); 67 68 69 } 70 void LuoVoittoLaskuri() 71 { 72 73 Label voittonautto = new Label(); 74 voittonautto.X = Screen.Right - 130; 75 voittonautto.Y = Screen.Top - 100; 76 voittonautto.TextColor = Color.Black; 77 voittonautto.Color = Color.White; 78 voittonautto.Title = "Tapot"; 79 voittonautto.BindTo(voittoLaskuri); 80 Add(voittonautto); 81 82 voittoLaskuri.UpperLimit += Voitto; 83 84 85 } 86 87 void Voitto() 88 { 89 MessageDisplay.Add("Voitit Pelin!"); 90 //TODO: Voitto! 64 91 } 65 92 … … 89 116 { 90 117 //1. Luetaan kuva uuteen ColorTileMappiin, kuvan nimen perässä ei .png-päätettä. 91 ColorTileMap ruudut = ColorTileMap.FromLevelAsset("cool tausta ");118 ColorTileMap ruudut = ColorTileMap.FromLevelAsset("cool tausta new"); 92 119 93 120 //2. Kerrotaan mitä aliohjelmaa kutsutaan, kun tietyn värinen pikseli tulee vastaan kuvatiedostossa. … … 143 170 AddCollisionHandler(pelaaja, "bossi", delegate(PhysicsObject A, PhysicsObject B) 144 171 { 172 PelaajaVahingoittuu(A, B, 2); 173 }); 174 175 AddCollisionHandler(pelaaja, "vihuammus", delegate(PhysicsObject A, PhysicsObject B) 176 { 177 PelaajaVahingoittuu(A, B, 2); 178 }); 179 180 AddCollisionHandler(pelaaja, "bossinammus", delegate(PhysicsObject A, PhysicsObject B) 181 { 145 182 PelaajaVahingoittuu(A, B, 4); 146 183 }); 147 184 148 185 elamaLaskuri = new DoubleMeter(10); 149 elamaLaskuri.MaxValue = 1 0;186 elamaLaskuri.MaxValue = 15; 150 187 elamaLaskuri.LowerLimit += ElamaLoppui; 151 188 … … 175 212 176 213 214 voittoLaskuri.MaxValue++; 215 177 216 178 217 } … … 192 231 Bossi.Brain = seuraajanAivot; 193 232 233 Timer Ampuminen = new Timer(); 234 Ampuminen.Interval = 1.0; //Kuinka usein bossi ampuu 235 Ampuminen.Timeout += delegate 236 { 237 if (pelaaja != null) 238 { 239 Vector suunta = pelaaja.Position - Bossi.Position; 240 241 if (suunta.Magnitude < 500) 242 { 243 suunta = suunta.Normalize(); 244 PhysicsObject vihunAmmus = new PhysicsObject(Laser); 245 vihunAmmus.Position = Bossi.Position + suunta * 30; 246 vihunAmmus.IgnoresCollisionResponse = true; 247 vihunAmmus.Size *= 0.1; 248 vihunAmmus.Angle = suunta.Angle; 249 Add(vihunAmmus); 250 vihunAmmus.Hit(suunta * 2000); 251 vihunAmmus.Tag = "bossinammus"; 252 } 253 } 254 }; 255 Ampuminen.Start(); 256 Bossi.Removed += delegate { Ampuminen.Stop(); }; 257 258 voittoLaskuri.MaxValue++; 194 259 } 195 260 … … 229 294 Vihollinen2.Brain = satunnaisAivot; 230 295 296 Timer Ampuminen = new Timer(); 297 Ampuminen.Interval = 3.5; 298 Ampuminen.Timeout += delegate 299 { 300 if (pelaaja != null) 301 { 302 Vector suunta = pelaaja.Position - Vihollinen2.Position; 303 304 if (suunta.Magnitude < 500) 305 { 306 suunta = suunta.Normalize(); 307 PhysicsObject vihunAmmus = new PhysicsObject(Laser); 308 vihunAmmus.Position = Vihollinen2.Position + suunta * 30; 309 vihunAmmus.IgnoresCollisionResponse = true; 310 vihunAmmus.Size *= 0.1; 311 vihunAmmus.Angle = suunta.Angle; 312 Add(vihunAmmus); 313 vihunAmmus.Hit(suunta * 2000); 314 vihunAmmus.Tag = "vihuammus"; 315 } 316 } 317 }; 318 Ampuminen.Start(); 319 Vihollinen2.Removed += delegate { Ampuminen.Stop(); }; 320 321 voittoLaskuri.MaxValue++; 231 322 } 232 323 … … 243 334 //rajahdys.Sound = rajahdysAani; 244 335 pelaaja.IgnoresExplosions = true; 336 337 String tag = kohde.Tag.ToString(); 338 if (tag == "pahis" || tag == "pahis2" || tag == "bossi") 339 { 340 voittoLaskuri.Value++; 341 } 245 342 } 246 343 ammus.Destroy(); … … 275 372 276 373 ammus.Image = Laser; 277 ase.FireRate = 3.0;374 ase.FireRate = 5.0; 278 375 279 376 AddCollisionHandler(ammus, AmmusOsui); -
2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/SpaceAdventure.csproj.Debug.cachefile
r6976 r6979 9 9 Content\laser.xnb 10 10 Content\Stuff.xnb 11 Content\cool tausta new.xnb -
2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/obj/x86/Debug/SpaceAdventure.csproj.FileListAbsolute.txt
r6976 r6979 7 7 C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Boss Ship_zpspn6osve5.xnb 8 8 C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\enemy ship 2.xnb 9 C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cloud.xnb10 9 C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\laser.xnb 11 10 C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\SpaceAdventure.exe … … 35 34 C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\obj\x86\Debug\SpaceAdventure.pdb 36 35 C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Stuff.xnb 36 C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Stuff.xnb 37 C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta new.xnb -
2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/obj/x86/Debug/cachefile-{A53A8295-A762-4A93-989B-CDE36F5CC9A7}-targetpath.txt
r6976 r6979 9 9 Content\laser.xnb 10 10 Content\Stuff.xnb 11 Content\cool tausta new.xnb -
2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventureContent/SpaceAdventureContent.contentproj
r6976 r6979 115 115 </Compile> 116 116 </ItemGroup> 117 <ItemGroup> 118 <Compile Include="cool tausta new.png"> 119 <Name>cool tausta new</Name> 120 <Importer>TextureImporter</Importer> 121 <Processor>TextureProcessor</Processor> 122 </Compile> 123 </ItemGroup> 117 124 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 118 125 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventureContent/obj/x86/Debug/ContentPipeline.xml
r6976 r6979 8 8 <Processor>TextureProcessor</Processor> 9 9 <Options>None</Options> 10 <Output>C:\MyTemp\ hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta.xnb</Output>11 <Time>2015-07-23T12: 17:59.4044483+03:00</Time>10 <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta.xnb</Output> 11 <Time>2015-07-23T12:53:23.8300809+03:00</Time> 12 12 </Item> 13 13 <Item> … … 17 17 <Processor>TextureProcessor</Processor> 18 18 <Options>None</Options> 19 <Output>C:\MyTemp\ hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool alus.xnb</Output>20 <Time>2015-07-2 3T09:45:06.3229068+03:00</Time>19 <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool alus.xnb</Output> 20 <Time>2015-07-21T14:12:05.8146469+03:00</Time> 21 21 </Item> 22 22 <Item> … … 26 26 <Processor>TextureProcessor</Processor> 27 27 <Options>None</Options> 28 <Output>C:\MyTemp\ hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool asteroid bu.xnb</Output>29 <Time>2015-07-2 3T09:45:06.3069068+03:00</Time>28 <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool asteroid bu.xnb</Output> 29 <Time>2015-07-21T14:55:03.3357265+03:00</Time> 30 30 </Item> 31 31 <Item> … … 35 35 <Processor>TextureProcessor</Processor> 36 36 <Options>None</Options> 37 <Output>C:\MyTemp\ hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolhyvisalus.xnb</Output>38 <Time>2015-07-2 3T09:45:06.3329068+03:00</Time>37 <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolhyvisalus.xnb</Output> 38 <Time>2015-07-22T11:35:17.1851187+03:00</Time> 39 39 </Item> 40 40 <Item> … … 44 44 <Processor>TextureProcessor</Processor> 45 45 <Options>None</Options> 46 <Output>C:\MyTemp\ hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolasteroidya.xnb</Output>47 <Time>2015-07-2 3T09:45:06.3259068+03:00</Time>46 <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolasteroidya.xnb</Output> 47 <Time>2015-07-21T14:55:35.1129265+03:00</Time> 48 48 </Item> 49 49 <Item> … … 53 53 <Processor>TextureProcessor</Processor> 54 54 <Options>None</Options> 55 <Output>C:\MyTemp\ hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool space.xnb</Output>56 <Time>2015-07-2 3T09:45:06.4709068+03:00</Time>55 <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool space.xnb</Output> 56 <Time>2015-07-22T11:05:32.8286354+03:00</Time> 57 57 </Item> 58 58 <Item> … … 62 62 <Processor>TextureProcessor</Processor> 63 63 <Options>None</Options> 64 <Output>C:\MyTemp\ hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Boss Ship_zpspn6osve5.xnb</Output>65 <Time>2015-07-2 3T09:45:06.3039068+03:00</Time>64 <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Boss Ship_zpspn6osve5.xnb</Output> 65 <Time>2015-07-22T12:56:39.8323187+03:00</Time> 66 66 </Item> 67 67 <Item> … … 71 71 <Processor>TextureProcessor</Processor> 72 72 <Options>None</Options> 73 <Output>C:\MyTemp\ hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\enemy ship 2.xnb</Output>74 <Time>2015-07-2 3T09:45:06.3299068+03:00</Time>73 <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\enemy ship 2.xnb</Output> 74 <Time>2015-07-22T13:01:57.3205187+03:00</Time> 75 75 </Item> 76 76 <Item> … … 80 80 <Processor>TextureProcessor</Processor> 81 81 <Options>None</Options> 82 <Output>C:\MyTemp\ hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\laser.xnb</Output>83 <Time>2015-07-23T09: 46:46.4089068+03:00</Time>82 <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\laser.xnb</Output> 83 <Time>2015-07-23T09:57:07.8638619+03:00</Time> 84 84 </Item> 85 85 <Item> … … 89 89 <Processor>TextureProcessor</Processor> 90 90 <Options>None</Options> 91 <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Stuff.xnb</Output> 92 <Time>2015-07-23T11:23:12.2378915+03:00</Time> 91 <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Stuff.xnb</Output> 92 <Time>2015-07-23T12:42:37.5810809+03:00</Time> 93 </Item> 94 <Item> 95 <Source>cool tausta new.png</Source> 96 <Name>cool tausta new</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta new.xnb</Output> 101 <Time>2015-07-23T13:25:00.6790809+03:00</Time> 93 102 </Item> 94 103 <BuildSuccessful>true</BuildSuccessful> … … 98 107 <BuildConfiguration>Debug</BuildConfiguration> 99 108 <CompressContent>false</CompressContent> 100 <RootDirectory>C:\MyTemp\ hyva\SpaceAdventure\SpaceAdventureContent\</RootDirectory>101 <LoggerRootDirectory>C:\MyTemp\ hyva\SpaceAdventure\SpaceAdventure\</LoggerRootDirectory>102 <IntermediateDirectory>C:\MyTemp\ hyva\SpaceAdventure\SpaceAdventureContent\obj\x86\Debug\</IntermediateDirectory>103 <OutputDirectory>C:\MyTemp\ hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\</OutputDirectory>109 <RootDirectory>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventureContent\</RootDirectory> 110 <LoggerRootDirectory>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\</LoggerRootDirectory> 111 <IntermediateDirectory>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventureContent\obj\x86\Debug\</IntermediateDirectory> 112 <OutputDirectory>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\</OutputDirectory> 104 113 </Settings> 105 114 <Assemblies> … … 138 147 <Assembly> 139 148 <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> 140 <Value>2015-07-09T14: 19:15.2277481+03:00</Value>149 <Value>2015-07-09T14:51:24.2760228+03:00</Value> 141 150 </Assembly> 142 151 </Assemblies>
Note: See TracChangeset
for help on using the changeset viewer.