Changeset 2447 for 2011/24/LauriK/Call of garden Modern carrotfare 2/Call of garden Modern carrotfare 2/Peli.cs
- Timestamp:
- 2011-07-18 21:11:18 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/24/LauriK/Call of garden Modern carrotfare 2/Call of garden Modern carrotfare 2/Peli.cs
r2445 r2447 14 14 const int RUUDUN_KOKO = 40; 15 15 16 int kentanNro = 0; 16 public int kentanNro = 0; 17 18 public int elamat = 100; 17 19 18 20 ScoreList topLista = new ScoreList(10, false, 0); … … 53 55 Image maalinKuva = LoadImage("Maali"); 54 56 Image alkuvalikko = LoadImage("alkuvalikko"); 57 Image peliPaattyi = LoadImage("pelipaattyi"); 55 58 56 59 ExplosionSystem rajahdys; 57 int pMaxMaara = 50 ;60 int pMaxMaara = 5000000; 58 61 59 62 public override void Begin() … … 80 83 } 81 84 82 void Valikko()85 public void Valikko() 83 86 { 84 87 Camera.Reset(); … … 99 102 versio.Font = Font.DefaultLargeBold; 100 103 Add(versio); 101 versio.Text = "Beta 2. 0";104 versio.Text = "Beta 2.1"; 102 105 103 106 MediaPlayer.Play("alkuaani"); … … 113 116 } 114 117 115 void SeuraavaKentta(int kentanNro) 116 { 118 public void SeuraavaKentta(int kentanNro) 119 { 120 pelaajallaOnLaser = false; 121 117 122 if (kentanNro == 0) Valikko(); 118 123 if (kentanNro == 1) luoAlustus1(); … … 124 129 private void luoAlustus1() 125 130 { 131 126 132 Camera.Reset(); 127 133 … … 609 615 if (Vector.Distance(s.Position, item.Position) < s.ExplosionRadius) 610 616 { 611 porkkana.Stop(); 612 613 MediaPlayer.Play("pling"); 614 615 porkkana.Destroy(); 616 617 LuoHautakivi(); 618 619 LopetaPeli(); 617 elamat -= 50; 618 619 if (elamat < 1) 620 { 621 porkkana.Stop(); 622 623 MediaPlayer.Play("pling"); 624 625 porkkana.Destroy(); 626 627 LuoHautakivi(); 628 629 LopetaPeli(); 620 630 631 } 621 632 } 622 } 623 624 633 } 625 634 } 626 635 … … 700 709 { 701 710 pistelaskuri.Value += 500; 702 //kentanNro = 2;711 kentanNro = 2; 703 712 SeuraavaKentta(kentanNro); 704 713 kentanNro = 2; … … 708 717 { 709 718 pistelaskuri.Value += 500; 710 //kentanNro = 3;719 kentanNro = 3; 711 720 maali.Destroy(); 712 721 SeuraavaKentta(kentanNro); … … 721 730 MediaPlayer.Stop(); 722 731 723 Label lopetus = new Label(); 724 lopetus.SizeMode = TextSizeMode.Wrapped; 725 lopetus.Width = Screen.Width -100; 726 lopetus.Height = Screen.Height; 727 lopetus.TextColor = Color.Orange; 728 lopetus.Font = Font.DefaultLargeBold; 729 Add(lopetus); 730 lopetus.Text = " Peli päättyi.\n" + 731 "Paina Escape/Start mennäksesi valikkoon tai Enter/A aloittaaksesi alusta."; 732 733 ClearControls(); 734 732 //Label lopetus = new Label(); 733 //lopetus.SizeMode = TextSizeMode.Wrapped; 734 //lopetus.Width = Screen.Width -100; 735 //lopetus.Height = Screen.Height; 736 //lopetus.TextColor = Color.Orange; 737 //lopetus.Font = Font.DefaultLargeBold; 738 //Add(lopetus); 739 //lopetus.Text = " Peli päättyi.\n" + 740 //"Paina Escape/Start mennäksesi valikkoon tai Enter/A aloittaaksesi alusta."; 741 742 //ClearControls(); 743 744 ClearAll(); 745 746 Level.Background.Image = peliPaattyi; 747 Level.Background.Width = Screen.Width; 748 Level.Background.Height = Screen.Height; 749 735 750 Keyboard.Listen(Key.Enter, ButtonState.Pressed, SeuraavaKentta, "Aloita alusta", 1); 736 751 … … 797 812 void TeeKentta2() 798 813 { 814 799 815 MediaPlayer.Stop(); 800 816 … … 864 880 void cheatIkkuna() 865 881 { 866 InputWindow cheatIkkuna = new InputWindow(" Kysymys", "Vastaa kysymykseen");882 InputWindow cheatIkkuna = new InputWindow("Cheatikkuna", "Anna cheatkoodi"); 867 883 cheatIkkuna.TextEntered += ProcessInput; 868 884 Add(cheatIkkuna); … … 876 892 { 877 893 pelaajallaOnLaser = true; 894 kentanNro = 1; 895 SeuraavaKentta(kentanNro); 878 896 MessageDisplay.Add("Laserase aktivoitu!"); 879 897 … … 897 915 MessageDisplay.Add("Väärä koodi!"); 898 916 } 899 900 901 917 902 918 } 903 919 }
Note: See TracChangeset
for help on using the changeset viewer.