- Timestamp:
- 2012-06-15 10:26:25 (11 years ago)
- Location:
- 2012/24/LauriK/Call of Garden Tomato oppression
- Files:
-
- 3 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/24/LauriK/Call of Garden Tomato oppression/Call of Garden Tomato oppression/Call of Garden Tomato oppression/Call of Garden Tomato oppression.csproj.Debug.cachefile
r3029 r3061 24 24 Content\tomaattipalkki_tyhja.xnb 25 25 Content\Lipas2.xnb 26 Content\teema.xnb 26 27 Content\pullava.wma 27 28 Content\derp.wma … … 30 31 Content\ghostbusters.wma 31 32 Content\warning.wma 33 Content\teema.wma 32 34 Content\kentta1.txt 33 35 kentta1.txt -
2012/24/LauriK/Call of Garden Tomato oppression/Call of Garden Tomato oppression/Call of Garden Tomato oppression/Call_of_Garden_Tomato_oppression.cs
r3029 r3061 12 12 const double hyppyNopeus = 500; 13 13 const int RUUDUN_KOKO = 40; 14 int kenttaNro = 0; 14 15 15 16 IntMeter pisteLaskuri; 16 17 17 18 public bool pelaajallaOnAse = true; 18 public bool pelaajaNakyvissa= false;19 20 string cheat1 = " ";19 public bool IntelKeratty = false; 20 21 string cheat1 = "MaxAmmo"; 21 22 22 23 DoubleMeter voimaMittari; … … 47 48 topLista = DataStorage.Load<ScoreList>(topLista, "pisteet.xml"); 48 49 49 ClearControls(); 50 ClearAll(); 51 52 MediaPlayer.Play("teema"); 53 54 kenttaNro = 0; 55 seuraavaKentta(kenttaNro); 56 } 57 58 void valikko() 59 { 60 kenttaNro = 0; 61 ClearAll(); 50 62 51 63 MultiSelectWindow valikko = new MultiSelectWindow("Call of Garden: Tomato Oppression", 52 "Start Game", "Highscores", "Controls", "Exit");64 "Start Game", "Highscores", "Controls", "Exit"); 53 65 valikko.ItemSelected += PainettiinValikonNappia; 54 66 Add(valikko); 55 67 valikko.DefaultCancel = 3; 56 68 valikko.Color = Color.Transparent; 69 valikko.SetButtonColor(Color.Silver); 70 valikko.SelectionColor = Color.LimeGreen; 71 72 MessageDisplay.BackgroundColor = Color.Transparent; 73 MessageDisplay.TextColor = Color.Ruby; 74 75 MediaPlayer.Resume(); 76 MediaPlayer.IsRepeating = true; 77 MediaPlayer.Volume = 1.0; 57 78 58 79 Level.Background.Image = ValikkoTaustaKuva; … … 65 86 void AloitaPeli() 66 87 { 88 MediaPlayer.Pause(); 89 MediaPlayer.IsRepeating = false; 90 67 91 Gravity = new Vector(0, -1000); 68 92 … … 81 105 Camera.ZoomFactor = 1; 82 106 Camera.StayInLevel = true; 107 } 108 109 void seuraavaKentta(int kenttaNro) 110 { 111 if (kenttaNro == 0) valikko(); 112 else if (kenttaNro == 1) AloitaPeli(); 113 //else if (kenttaNro == 2) LuoKentta("kentta2.txt"); 114 //else if (kenttaNro == 3) LuoKentta("kentta3.txt"); 115 else if (kenttaNro == 2) LopetaPeli(); 83 116 } 84 117 … … 93 126 ruudut.SetTileMethod('I', lisaaIntel); 94 127 ruudut.SetTileMethod('L', luoLipas); 128 ruudut.SetTileMethod('M', luoMaali); 95 129 ruudut.Execute(20, 20); 96 130 … … 100 134 luoVoimaMittari(); 101 135 lisaaNappaimet(); 102 136 103 137 Level.Background.Image = ValikkoTaustaKuva; 104 138 //Level.Background.Width = Screen.Width; … … 146 180 { 147 181 porkkana.Weapon.Ammo.Value += 10; 148 CollisionHandler.DestroyTarget(porkkana, "lipas");149 182 MessageDisplay.Add("You picked up 10 ammo!"); 150 183 151 184 }); 185 186 AddCollisionHandler (porkkana, "lipas", CollisionHandler.DestroyTarget); 187 152 188 porkkana.Tag = "Porkkana"; 153 189 … … 210 246 tomaattiMittari.MinValue = 0; 211 247 212 ProgressBar tomaattiPalkki = new ProgressBar( 30, 5);248 ProgressBar tomaattiPalkki = new ProgressBar(15, 3); 213 249 214 250 Timer mittarinLiikuttamisAjastin = new Timer(); … … 218 254 { 219 255 tomaattiPalkki.Position = tomaatti.Position; 220 tomaattiPalkki.Y = tomaatti.Y + 10;256 tomaattiPalkki.Y = tomaatti.Y + 20; 221 257 }; 222 258 … … 231 267 kuollutTomaatti.Y = tomaatti.Y + 10; 232 268 kuollutTomaatti.IgnoresExplosions = true; 269 kuollutTomaatti.IgnoresCollisionResponse = true; 270 kuollutTomaatti.IgnoresGravity = true; 233 271 tomaatti.X = 100000000; 234 272 tomaatti.Y = 100000000; … … 250 288 251 289 Timer tomaattiHuomasi = new Timer(); 252 tomaattiHuomasi.Interval = 1;290 tomaattiHuomasi.Interval = 0.1; 253 291 tomaattiHuomasi.Timeout += delegate 254 292 { … … 259 297 seuraajanAivot.Active = true; 260 298 randomAivot.Active = false; 261 pelaajaNakyvissa = true;262 299 MediaPlayer.Play("Warning"); 263 300 MediaPlayer.IsRepeating = true; … … 266 303 } 267 304 268 else 269 { 270 Timer.SingleShot(5, delegate 271 { 272 seuraajanAivot.Active = false; 273 randomAivot.Active = true; 274 pelaajaNakyvissa = false; 275 MediaPlayer.Pause(); 276 }); 277 } 305 //else 306 //{ 307 // Timer.SingleShot(5, delegate 308 // { 309 // seuraajanAivot.Active = false; 310 // randomAivot.Active = true; 311 // MediaPlayer.Pause(); 312 // }); 313 //} 278 314 }; 279 315 tomaattiHuomasi.Start(); … … 347 383 kansio.Destroy(); 348 384 MessageDisplay.Add("You picked up the files!\n Now return to the base."); 385 IntelKeratty = true; 349 386 } 350 387 … … 389 426 { 390 427 PhysicsObject ammus = porkkana.Weapon.Shoot(); 391 392 pelaajaNakyvissa = true;393 428 394 429 if (ammus != null) … … 435 470 { 436 471 MultiSelectWindow cheatvalikko = new MultiSelectWindow("Choose song", "Pullava-song", 437 "Derp-song", "Super Mario- song", "Simpsons theme song", "Ghostbusters theme song", " Pause current song");472 "Derp-song", "Super Mario- song", "Simpsons theme song", "Ghostbusters theme song", "Spy theme song", "Pause current song"); 438 473 cheatvalikko.ItemSelected += PainettiinMusiikkiValikonNappia; 439 474 Add(cheatvalikko); … … 446 481 if (vastaus == cheat1) 447 482 { 448 483 porkkana.Weapon.Ammo.Value = 100; 449 484 } 450 485 } … … 455 490 { 456 491 case 0: 457 458 AloitaPeli(); 492 493 kenttaNro++; 494 seuraavaKentta(kenttaNro); 459 495 460 496 break; … … 462 498 case 1: 463 499 464 Keyboard.Listen(Key.Enter, ButtonState.Pressed, Begin, "Palaa päävalikkoon");500 Keyboard.Listen(Key.Enter, ButtonState.Pressed, valikko, "Palaa päävalikkoon"); 465 501 466 502 HighScoreWindow topIkkuna = new HighScoreWindow( … … 474 510 475 511 case 2: 512 513 MediaPlayer.Pause(); 476 514 477 515 lisaaNappaimet(); 478 516 ShowControlHelp(); 479 517 ClearControls(); 480 Begin();518 valikko(); 481 519 482 520 break; … … 514 552 MessageDisplay.Add("Ghostbusters theme song activated!"); 515 553 break; 554 516 555 case 5: 556 MediaPlayer.Play("teema"); 557 MessageDisplay.Add("Spy theme activated!"); 558 break; 559 560 case 6: 517 561 MediaPlayer.Pause(); 518 562 MessageDisplay.Add("Music paused!"); … … 529 573 ajastin.Timeout += delegate 530 574 { 531 if (pelaajaNakyvissa == true) 532 { 575 Vector suunta = (porkkana.Position - pahis.Position).Normalize(); 576 pahis.Angle = suunta.Angle; 577 533 578 PhysicsObject VihuAmmus = pahis.Weapon.Shoot(); 534 579 … … 541 586 VihuAmmus.MaximumLifetime = TimeSpan.FromSeconds(5); 542 587 } 543 }544 588 }; 545 589 ajastin.Start(); … … 553 597 ammus.Destroy(); 554 598 } 599 600 else 601 { 602 ammus.Destroy(); 603 } 604 555 605 } 556 606 … … 561 611 if (voimaMittari.Value < 1) 562 612 { 613 MessageDisplay.Add("You died!"); 563 614 LopetaPeli(); 564 615 } … … 610 661 void LopetaPeli() 611 662 { 663 MediaPlayer.Play("teema"); 664 612 665 HighScoreWindow topIkkuna = new HighScoreWindow( 613 666 "Highscores", … … 620 673 void TallennaPisteet(Window sender) 621 674 { 675 MediaPlayer.Pause(); 622 676 DataStorage.Save<ScoreList>(topLista, "pisteet.xml"); 623 677 ClearAll(); … … 628 682 Level.Background.Position = Screen.Center; 629 683 630 Begin();684 valikko(); 631 685 } 632 686 … … 654 708 { 655 709 PhysicsObject lipas = new PhysicsObject(leveys, korkeus); 710 lipas.Height = 10; 711 lipas.Width = 10; 656 712 lipas.Image = lippaanKuva; 657 713 lipas.Tag = "lipas"; 714 lipas.Position = paikka; 658 715 Add(lipas); 659 716 } 717 718 void luoMaali(Vector paikka, double leveys, double korkeus) 719 { 720 PhysicsObject maali = new PhysicsObject(leveys, korkeus); 721 maali.Color = Color.Gold; 722 maali.Mass = 4; 723 maali.Position = paikka; 724 725 Add(maali); 726 727 AddCollisionHandler(maali, porkkana, delegate 728 { 729 if (IntelKeratty == true) 730 { 731 kenttaNro++; 732 seuraavaKentta(kenttaNro); 733 } 734 }); 735 736 } 737 738 660 739 } -
2012/24/LauriK/Call of Garden Tomato oppression/Call of Garden Tomato oppression/Call of Garden Tomato oppression/bin/x86/Debug/Content/kentta1.txt
r3029 r3061 9 9 --------- _ T ---- ------------ 10 10 - - - ___T - - - - 11 - P 11 - P M L --- - _____T -T --- T T - - 12 12 ---------______________________________---------- -
2012/24/LauriK/Call of Garden Tomato oppression/Call of Garden Tomato oppression/Call of Garden Tomato oppression/obj/x86/Debug/Call of Garden Tomato oppression.csproj.FileListAbsolute.txt
r3029 r3061 40 40 C:\MyTemp\LauriK\Call of Garden Tomato oppression\Call of Garden Tomato oppression\Call of Garden Tomato oppression\bin\x86\Debug\Content\tomaattipalkki_tyhja.xnb 41 41 C:\MyTemp\LauriK\Call of Garden Tomato oppression\Call of Garden Tomato oppression\Call of Garden Tomato oppression\bin\x86\Debug\Content\Lipas2.xnb 42 C:\MyTemp\LauriK\Call of Garden Tomato oppression\Call of Garden Tomato oppression\Call of Garden Tomato oppression\bin\x86\Debug\Content\teema.xnb 43 C:\MyTemp\LauriK\Call of Garden Tomato oppression\Call of Garden Tomato oppression\Call of Garden Tomato oppression\bin\x86\Debug\Content\teema.wma -
2012/24/LauriK/Call of Garden Tomato oppression/Call of Garden Tomato oppression/Call of Garden Tomato oppression/obj/x86/Debug/ContentPipeline-{8CFED7BE-A075-487F-8778-E023BE6594E5}.xml
r3029 r3061 168 168 <Options>None</Options> 169 169 <Output>C:\MyTemp\LauriK\Call of Garden Tomato oppression\Call of Garden Tomato oppression\Call of Garden Tomato oppression\bin\x86\Debug\Content\kentta1.xnb</Output> 170 <Time>2012-06-1 4T14:59:14.9979612+03:00</Time>170 <Time>2012-06-15T10:12:03.3330995+03:00</Time> 171 171 </Item> 172 172 <Item> … … 204 204 <Options>None</Options> 205 205 <Output>C:\MyTemp\LauriK\Call of Garden Tomato oppression\Call of Garden Tomato oppression\Call of Garden Tomato oppression\bin\x86\Debug\Content\kentta_testi.xnb</Output> 206 <Time>2012-06-1 4T14:59:38.6747612+03:00</Time>206 <Time>2012-06-15T10:13:50.3666995+03:00</Time> 207 207 </Item> 208 208 <Item> … … 232 232 <Output>C:\MyTemp\LauriK\Call of Garden Tomato oppression\Call of Garden Tomato oppression\Call of Garden Tomato oppression\bin\x86\Debug\Content\Lipas2.xnb</Output> 233 233 <Time>2012-06-11T10:51:39.4379113+03:00</Time> 234 </Item> 235 <Item> 236 <Source>teema.mp3</Source> 237 <Name>teema</Name> 238 <Importer>Mp3Importer</Importer> 239 <Processor>SongProcessor</Processor> 240 <Options>None</Options> 241 <Output>C:\MyTemp\LauriK\Call of Garden Tomato oppression\Call of Garden Tomato oppression\Call of Garden Tomato oppression\bin\x86\Debug\Content\teema.xnb</Output> 242 <Extra>C:\MyTemp\LauriK\Call of Garden Tomato oppression\Call of Garden Tomato oppression\Call of Garden Tomato oppression\bin\x86\Debug\Content\teema.wma</Extra> 243 <Time>2012-06-15T09:47:39.1892995+03:00</Time> 234 244 </Item> 235 245 <BuildSuccessful>true</BuildSuccessful> -
2012/24/LauriK/Call of Garden Tomato oppression/Call of Garden Tomato oppression/Call of Garden Tomato oppression/obj/x86/Debug/cachefile-{8CFED7BE-A075-487F-8778-E023BE6594E5}-targetpath.txt
r3029 r3061 30 30 Content\tomaattipalkki_tyhja.xnb 31 31 Content\Lipas2.xnb 32 Content\teema.xnb 33 Content\teema.wma 32 34 Content\kentta1.txt -
2012/24/LauriK/Call of Garden Tomato oppression/Call of Garden Tomato oppression/Call of Garden Tomato oppressionContent/Call of Garden Tomato oppressionContent.contentproj
r3029 r3061 208 208 </Compile> 209 209 </ItemGroup> 210 <ItemGroup> 211 <Compile Include="teema.mp3"> 212 <Name>teema</Name> 213 <Importer>Mp3Importer</Importer> 214 <Processor>SongProcessor</Processor> 215 </Compile> 216 </ItemGroup> 210 217 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 211 218 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2012/24/LauriK/Call of Garden Tomato oppression/Call of Garden Tomato oppression/Call of Garden Tomato oppressionContent/kentta1.txt
r3029 r3061 9 9 --------- _ T ---- ------------ 10 10 - - - ___T - - - - 11 - P 11 - P M L --- - _____T -T --- T T - - 12 12 ---------______________________________---------- -
2012/24/LauriK/Call of Garden Tomato oppression/Call of Garden Tomato oppression/Call of Garden Tomato oppressionContent/kentta_testi.txt
r3029 r3061 14 14 15 15 16 L P 17 ------- 16 L P I M 17 ------------------ 18 18 T T 19 19 -------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.