Ignore:
Timestamp:
2011-07-18 21:11:18 (12 years ago)
Author:
lavevake
Message:

Beta 2.1

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  
    1414    const int RUUDUN_KOKO = 40; 
    1515 
    16     int kentanNro = 0; 
     16    public int kentanNro = 0; 
     17 
     18    public int elamat = 100; 
    1719 
    1820    ScoreList topLista = new ScoreList(10, false, 0); 
     
    5355    Image maalinKuva = LoadImage("Maali"); 
    5456    Image alkuvalikko = LoadImage("alkuvalikko"); 
     57    Image peliPaattyi = LoadImage("pelipaattyi"); 
    5558 
    5659    ExplosionSystem rajahdys; 
    57     int pMaxMaara = 50; 
     60    int pMaxMaara = 5000000; 
    5861 
    5962    public override void Begin() 
     
    8083    } 
    8184 
    82     void Valikko() 
     85    public void Valikko() 
    8386    { 
    8487        Camera.Reset(); 
     
    99102        versio.Font = Font.DefaultLargeBold; 
    100103        Add(versio); 
    101         versio.Text = "Beta 2.0"; 
     104        versio.Text = "Beta 2.1"; 
    102105         
    103106        MediaPlayer.Play("alkuaani"); 
     
    113116    } 
    114117     
    115     void SeuraavaKentta(int kentanNro) 
    116     { 
     118    public void SeuraavaKentta(int kentanNro) 
     119    { 
     120        pelaajallaOnLaser = false; 
     121         
    117122        if (kentanNro == 0) Valikko(); 
    118123        if (kentanNro == 1) luoAlustus1(); 
     
    124129    private void luoAlustus1() 
    125130    { 
     131         
    126132        Camera.Reset(); 
    127133 
     
    609615            if (Vector.Distance(s.Position, item.Position) < s.ExplosionRadius) 
    610616            { 
    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(); 
    620630       
     631                }                 
    621632            } 
    622         } 
    623      
    624      
     633        }         
    625634    } 
    626635 
     
    700709            { 
    701710                pistelaskuri.Value += 500; 
    702                 //kentanNro = 2; 
     711                kentanNro = 2; 
    703712                SeuraavaKentta(kentanNro); 
    704713                kentanNro = 2; 
     
    708717            { 
    709718                pistelaskuri.Value += 500; 
    710                 //kentanNro = 3; 
     719                kentanNro = 3; 
    711720                maali.Destroy(); 
    712721                SeuraavaKentta(kentanNro); 
     
    721730        MediaPlayer.Stop(); 
    722731         
    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         
    735750        Keyboard.Listen(Key.Enter, ButtonState.Pressed, SeuraavaKentta, "Aloita alusta", 1); 
    736751         
     
    797812    void TeeKentta2() 
    798813    {         
     814         
    799815        MediaPlayer.Stop();        
    800816         
     
    864880    void cheatIkkuna() 
    865881    { 
    866         InputWindow cheatIkkuna = new InputWindow("Kysymys", "Vastaa kysymykseen"); 
     882        InputWindow cheatIkkuna = new InputWindow("Cheatikkuna", "Anna cheatkoodi"); 
    867883        cheatIkkuna.TextEntered += ProcessInput; 
    868884        Add(cheatIkkuna); 
     
    876892        { 
    877893            pelaajallaOnLaser = true; 
     894            kentanNro = 1; 
     895            SeuraavaKentta(kentanNro); 
    878896            MessageDisplay.Add("Laserase aktivoitu!"); 
    879897 
     
    897915            MessageDisplay.Add("Väärä koodi!"); 
    898916        } 
    899  
    900  
    901      
     917   
    902918    } 
    903919}              
Note: See TracChangeset for help on using the changeset viewer.