- Timestamp:
- 2015-07-03 11:38:18 (8 years ago)
- Location:
- 2015/27/EemilI/infected - Copy/infected
- Files:
-
- 27 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/EemilI/infected - Copy/infected/infected/infected.cs
r6772 r6784 17 17 Image pistoolikuva = LoadImage("JuanDeag"); 18 18 Image halekuva = LoadImage("shotfun"); 19 19 Image lappukuva = LoadImage("lappu"); 20 IntMeter pistelaskuri; 21 IntMeter lappulaskuri; 22 20 23 AssaultRifle ase; 21 24 22 25 List<Vector> spawnipaikat = new List<Vector>(); 26 List<Vector> lappujenspawnipaikat = new List<Vector>(); 23 27 List<Label> valikonKohdat; 24 28 … … 27 31 28 32 Valikko(); 29 //IsFullScreen = true;33 IsFullScreen = true; 30 34 SmoothTextures = true; 31 35 MediaPlayer.Play("Volatile Reaction"); 36 32 37 } 33 38 void LuoHahmo(Vector paikka, double leveys, double korkeus) … … 39 44 Add(mies); 40 45 AddCollisionHandler(mies, "zombi", PelaajaKuolee); 46 AddCollisionHandler(mies, "lappu", KeraaLappu); 41 47 mies.CollisionIgnoreGroup = 3; 48 42 49 43 50 ase = new AssaultRifle(50,6); … … 58 65 //siirrin.Timeout += delegate { valo.Position = mies.Position; }; 59 66 //siirrin.Start(); 67 60 68 } 61 69 … … 68 76 mappi.SetTileMethod(Color.Red, LuoHahmo); 69 77 mappi.SetTileMethod(Color.FromHexCode("7F0000"), LuoTurvaSeina); 78 mappi.SetTileMethod(Color.Orange, LuoLappu); 70 79 mappi.Execute(40, 40); 71 80 LuoPisteLaskuri(); 81 LuoLappuLaskuri(); 72 82 Level.AmbientLight = 0.5; 73 83 … … 85 95 Camera.StayInLevel = true; 86 96 Camera.Zoom(1.0); 97 98 GameObject tausta = new GameObject(Level.Width, Level.Height); 99 tausta.Color = Color.Black; 100 Add(tausta, -3); 87 101 } 88 102 … … 142 156 143 157 144 aikaLaskuri.Interval = 4;158 aikaLaskuri.Interval = 10; 145 159 aikaLaskuri.Timeout += LuoUusiZombi; 146 160 aikaLaskuri.Start(); 161 162 Timer lappuAjastin = new Timer(); 163 lappuAjastin.Interval = 30; 164 lappuAjastin.Timeout += LuoUusiLappu; 165 lappuAjastin.Start(); 147 166 148 167 Label aikaNaytto = new Label(); … … 256 275 Timer.SingleShot(1, Valikko); 257 276 } 258 IntMeter pistelaskuri;277 259 278 void LuoPisteLaskuri() 260 279 { … … 262 281 263 282 Label pisteNaytto = new Label(); 264 pisteNaytto.X = Screen. Left + 75;265 pisteNaytto.Y = Screen.Top - 75;283 pisteNaytto.X = Screen.Right - pisteNaytto.Width; 284 pisteNaytto.Y = Screen.Top - pisteNaytto.Height*2; 266 285 pisteNaytto.TextColor = Color.White; 267 286 pisteNaytto.Color = Color.Black; 287 268 288 269 289 pisteNaytto.BindTo(pistelaskuri); … … 382 402 kauppa.AddItemHandler(0, delegate 383 403 { 384 if (pistelaskuri.Value >= 1 )385 { 386 pistelaskuri.Value -= 1 ;404 if (pistelaskuri.Value >= 100) 405 { 406 pistelaskuri.Value -= 100; 387 407 Keyboard.Listen(Key.D2, ButtonState.Pressed, VaihdaAse, "Ota haulikko esille", "haulikko"); 388 408 } … … 391 411 kauppa.AddItemHandler(1, delegate 392 412 { 393 if (pistelaskuri.Value >= 1)394 { 395 pistelaskuri.Value -= 1;413 if (pistelaskuri.Value >= 250) 414 { 415 pistelaskuri.Value -= 250; 396 416 Keyboard.Listen(Key.D3, ButtonState.Pressed, VaihdaAse, "Ota ak-47 esille", "ak47"); 397 417 } … … 399 419 }); 400 420 401 kauppa.AddItemHandler( 1, delegate421 kauppa.AddItemHandler(2, delegate 402 422 { 403 423 IsPaused = false; … … 405 425 Add(kauppa); 406 426 } 427 void LuoLappu(Vector paikka, double leveys, double korkeus) 428 { 429 430 lappujenspawnipaikat.Add(paikka); 431 432 433 } 434 void LuoLappuLaskuri() 435 { 436 lappulaskuri = new IntMeter(0,0,10); 437 438 Label lappunaytto = new Label(); 439 lappunaytto.X = Screen.Right - lappunaytto.Width; 440 lappunaytto.Y = Screen.Top - 75; 441 lappunaytto.TextColor = Color.White; 442 lappunaytto.Color = Color.Black; 443 444 lappulaskuri.UpperLimit += KaikkiLaputKeratty; 445 446 lappunaytto.BindTo(lappulaskuri); 447 Add(lappunaytto); 448 449 lappunaytto.IntFormatString = "Laput: {0:D1}/10"; 450 } 451 void LuoUusiLappu() 452 { 453 int indeksi = RandomGen.NextInt(0, lappujenspawnipaikat.Count - 1); 454 Vector paikka = lappujenspawnipaikat[indeksi]; 455 LuoLappu(paikka); 456 457 } 458 void LuoLappu(Vector paikka) 459 { 460 PhysicsObject lappu = new PhysicsObject(40, 40); 461 lappu.Tag = "lappu"; 462 lappu.Position = paikka; 463 lappu.Image = lappukuva; 464 465 Add(lappu); 466 } 467 void KaikkiLaputKeratty() 468 { 469 MessageDisplay.Add("Keräsit kaikki laput..."); 470 MessageDisplay.Add("Voit jatkaa jos haluat"); 471 } 472 void KeraaLappu(PhysicsObject pelaaja,PhysicsObject lappu) 473 { 474 MessageDisplay.Add("Keräsit lapun"); 475 lappulaskuri.Value++; 476 lappu.Destroy(); 477 } 407 478 } -
2015/27/EemilI/infected - Copy/infected/infected/infected.csproj.Debug.cachefile
r6772 r6784 14 14 Content\hale.xnb 15 15 Content\m4.xnb 16 Content\lappu.xnb 16 17 Content\Ghost Story.wma 17 18 Content\Volatile Reaction.wma -
2015/27/EemilI/infected - Copy/infected/infected/obj/x86/Debug/ContentPipeline-{B898C966-80ED-44D3-9FBA-1E981C2850D4}.xml
r6772 r6784 18 18 <Options>None</Options> 19 19 <Output>C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\mappi.xnb</Output> 20 <Time>2015-07-0 2T14:17:01.9048031+03:00</Time>20 <Time>2015-07-03T10:45:15.388847+03:00</Time> 21 21 </Item> 22 22 <Item> … … 83 83 <Options>None</Options> 84 84 <Output>C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\valikkokuva.xnb</Output> 85 <Time>2015-07-0 2T12:29:51.2191031+03:00</Time>85 <Time>2015-07-03T11:31:50.157247+03:00</Time> 86 86 </Item> 87 87 <Item> … … 138 138 <Output>C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\m4.xnb</Output> 139 139 <Time>2015-07-03T10:08:47.104847+03:00</Time> 140 </Item> 141 <Item> 142 <Source>lappu.png</Source> 143 <Name>lappu</Name> 144 <Importer>TextureImporter</Importer> 145 <Processor>TextureProcessor</Processor> 146 <Options>None</Options> 147 <Output>C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\lappu.xnb</Output> 148 <Time>2015-07-03T10:34:58.858847+03:00</Time> 140 149 </Item> 141 150 <BuildSuccessful>true</BuildSuccessful> -
2015/27/EemilI/infected - Copy/infected/infected/obj/x86/Debug/cachefile-{B898C966-80ED-44D3-9FBA-1E981C2850D4}-targetpath.txt
r6772 r6784 16 16 Content\hale.xnb 17 17 Content\m4.xnb 18 Content\lappu.xnb -
2015/27/EemilI/infected - Copy/infected/infected/obj/x86/Debug/infected.csproj.FileListAbsolute.txt
r6772 r6784 24 24 C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\pistol.xnb 25 25 C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\m4.xnb 26 C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\lappu.xnb -
2015/27/EemilI/infected - Copy/infected/infectedContent/infectedContent.contentproj
r6772 r6784 150 150 </Compile> 151 151 </ItemGroup> 152 <ItemGroup> 153 <Compile Include="lappu.png"> 154 <Name>lappu</Name> 155 <Importer>TextureImporter</Importer> 156 <Processor>TextureProcessor</Processor> 157 </Compile> 158 </ItemGroup> 152 159 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 153 160 <!-- 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.