示例#1
0
        public void Grafika_Smierc(SpriteBatch spriteBatch)
        {
            if ((Gracz1.zyje == false && GameState == Game1.Stan.Gra) && (Gracz2.zyje == true && GameState == Game1.Stan.Gra))
            {
                if (Game1.licznik_klatek % 13 == 0)
                {
                    Man_stoi = Content.Load<Texture2D>("Dead_swiatlo1");
                }
                if (Game1.licznik_klatek % 17 == 0)
                {
                    Man_stoi = Content.Load<Texture2D>("Dead_swiatlo2");
                }
                if (Game1.licznik_klatek % 23 == 0)
                {
                    GameState = Game1.Stan.Przegrana1;
                }
            }
            if (GameState == Game1.Stan.Przegrana1)
            {
                Man_prawo = Content.Load<Texture2D>("Dead");
                Man_lewo = Content.Load<Texture2D>("Dead");
                Man_krok_prawo = Content.Load<Texture2D>("Dead");
                Man_krok_lewo = Content.Load<Texture2D>("Dead");
                Man_gora = Content.Load<Texture2D>("Dead");
                Man_stoi = Content.Load<Texture2D>("Dead");
                Man_gora_krok = Content.Load<Texture2D>("Dead");
                Man_gora_krok2 = Content.Load<Texture2D>("Dead");
                spriteBatch.Draw(Player2win, new Vector2(200, 100), Color.White);
                if(Game1.Sound==true)
                p2w_sound.Play();
                GameState = Game1.Stan.Reset1;
            }
            if ((Gracz1.zyje == true && GameState == Game1.Stan.Gra) && (Gracz2.zyje == false && GameState == Game1.Stan.Gra))
            {
                if (Game1.licznik_klatek % 13 == 0)
                {
                    Man2_stoi = Content.Load<Texture2D>("Dead2_swiatlo1");
                }
                if (Game1.licznik_klatek % 17 == 0)
                {
                    Man2_stoi = Content.Load<Texture2D>("Dead2_swiatlo2");
                }
                if (Game1.licznik_klatek % 23 == 0)
                {
                    GameState = Game1.Stan.Przegrana2;
                }
            }
            if (GameState == Game1.Stan.Przegrana2)
            {
                Man2_prawo = Content.Load<Texture2D>("Dead2");
                Man2_lewo = Content.Load<Texture2D>("Dead2");
                Man2_krok_prawo = Content.Load<Texture2D>("Dead2");
                Man2_krok_lewo = Content.Load<Texture2D>("Dead2");
                Man2_gora = Content.Load<Texture2D>("Dead2");
                Man2_stoi = Content.Load<Texture2D>("Dead2");
                Man2_gora_krok = Content.Load<Texture2D>("Dead2");
                Man2_gora_krok2 = Content.Load<Texture2D>("Dead2");
                if(Game1.Sound==true)
                p1w_sound.Play();
                GameState = Game1.Stan.Reset2;
            }

            if ((Gracz1.zyje == false && GameState == Game1.Stan.Gra) && (Gracz2.zyje == false && GameState == Game1.Stan.Gra))
            {
                if (Game1.licznik_klatek % 13 == 0)
                {
                    Man_stoi = Content.Load<Texture2D>("Dead_swiatlo1");
                    Man2_stoi = Content.Load<Texture2D>("Dead2_swiatlo1");
                }
                if (Game1.licznik_klatek % 17 == 0)
                {
                    Man_stoi = Content.Load<Texture2D>("Dead_swiatlo2");
                    Man2_stoi = Content.Load<Texture2D>("Dead2_swiatlo2");
                }
                if (Game1.licznik_klatek % 23 == 0)
                {
                    GameState = Game1.Stan.Remis;
                }
            }
            if (GameState == Game1.Stan.Remis)
            {
                Man_prawo = Content.Load<Texture2D>("Dead");
                Man_lewo = Content.Load<Texture2D>("Dead");
                Man_krok_prawo = Content.Load<Texture2D>("Dead");
                Man_krok_lewo = Content.Load<Texture2D>("Dead");
                Man_gora = Content.Load<Texture2D>("Dead");
                Man_stoi = Content.Load<Texture2D>("Dead");
                Man_gora_krok = Content.Load<Texture2D>("Dead");
                Man_gora_krok2 = Content.Load<Texture2D>("Dead");
                Man2_prawo = Content.Load<Texture2D>("Dead2");
                Man2_lewo = Content.Load<Texture2D>("Dead2");
                Man2_krok_prawo = Content.Load<Texture2D>("Dead2");
                Man2_krok_lewo = Content.Load<Texture2D>("Dead2");
                Man2_gora = Content.Load<Texture2D>("Dead2");
                Man2_stoi = Content.Load<Texture2D>("Dead2");
                Man2_gora_krok = Content.Load<Texture2D>("Dead2");
                Man2_gora_krok2 = Content.Load<Texture2D>("Dead2");
                if(Game1.Sound==true)
                remis_sound.Play();
                GameState = Game1.Stan.Reset3;
            }
        }
示例#2
0
 public  void Reset_Gry(SpriteBatch spriteBatch)
 {
     bool reset = false;
     if (GameState == Game1.Stan.Reset1)
     {
         spriteBatch.Draw(Player2win, new Vector2(400, 100), Color.White);
         reset = true;
     }
     if (GameState == Game1.Stan.Reset2)
     {
         spriteBatch.Draw(Player1win, new Vector2(400, 100), Color.White);
         reset = true;
     }
     if (GameState == Game1.Stan.Reset3)
     {
         spriteBatch.Draw(remis, new Vector2(400, 100), Color.White);
         reset = true;
     }
     if (reset == true)
     {
         keyboardState = Keyboard.GetState();
         if (keyboardState.IsKeyDown(Keys.R))
         {
             Man_prawo = Content.Load<Texture2D>("bomber_prawo_stoi");
             Man_lewo = Content.Load<Texture2D>("bomber_lewo_stoi");
             Man_krok_prawo = Content.Load<Texture2D>("krok_prawo");
             Man_krok_lewo = Content.Load<Texture2D>("krok_lewo");
             Man_stoi = Content.Load<Texture2D>("man_stoi");
             Man_stoi_krok = Content.Load<Texture2D>("man_stoi_krok");
             Man_gora = Content.Load<Texture2D>("man_gora");
             Man_gora_krok = Content.Load<Texture2D>("Man_gora_krok");
             Man_gora_krok2 = Content.Load<Texture2D>("Man_gora_krok2");
             Man2_prawo = Content.Load<Texture2D>("bomber2_prawo_stoi");
             Man2_lewo = Content.Load<Texture2D>("bomber2_lewo_stoi");
             Man2_krok_prawo = Content.Load<Texture2D>("krok2_prawo");
             Man2_krok_lewo = Content.Load<Texture2D>("krok2_lewo");
             Man2_stoi = Content.Load<Texture2D>("man2_stoi");
             Man2_stoi_krok = Content.Load<Texture2D>("man2_stoi_krok");
             Man2_gora = Content.Load<Texture2D>("man2_gora");
             Man2_gora_krok = Content.Load<Texture2D>("Man2_gora_krok");
             Man2_gora_krok2 = Content.Load<Texture2D>("Man2_gora_krok2");
             Mapa1.Stawianie_klockow();
             Gracz1.postawionychBomb = 0;
             Gracz1.maxBomb = 2;
             Gracz1.szybkość = 2;
             Gracz1.moc = 3;
             Gracz1.kara = false;
             Gracz1.Position = new Vector2(275, 55);
             Gracz1.zyje = true;
             Gracz2.postawionychBomb = 0;
             Gracz2.Position = new Vector2(900, 630);
             Gracz2.zyje = true;
             Gracz2.kara = false;
             Gracz2.maxBomb = 2;
             Gracz2.szybkość = 2;
             Gracz2.moc = 3;
             GameState = Game1.Stan.Gra;
         }
     }
 }
示例#3
0
 public void PrzypiszReferencje(GraphicsDeviceManager graphics, ContentManager Content, Mapa Mapa1,Menu Menu1,Player Gracz1,Player Gracz2,Kontroler Klawiatura1,Game1.Stan GameState, KeyboardState keyboardState)
 {
     this.graphics = graphics;
     this.Content = Content;
     this.Mapa1 = Mapa1;
     this.Menu1 = Menu1;
     this.Gracz1 = Gracz1;
     this.Gracz2 = Gracz2;
     this.Klawiatura1 = Klawiatura1;
     this.GameState = GameState;
     this.keyboardState = keyboardState;
 }