コード例 #1
0
        static public void introUpdate(GameTime gameTime)
        {
            if (Game1.Jogador.Position == Vector2.Zero && check3 == false)
            {
                FontSupport.Mensagem("Onde estou?");
            }

            if (Game1.Jogador.Position != ponto1 && check1 == false)
            {
                Game1.Jogador.Position = Game1.Jogador.Position + Vector2.UnitY;
                if (Game1.Jogador.Position == ponto1 && check1 == false)
                {
                    check1 = true;

                    FontSupport.Mensagem("Onde o frio encontra o medo.");
                }
            }

            if (Game1.Jogador.Position != ponto2 && check1 == true && check2 == false)
            {
                Game1.Jogador.Position = Game1.Jogador.Position + Vector2.UnitX;
                if (Game1.Jogador.Position == ponto2 && check2 == false)
                {
                    check2 = true;
                    FontSupport.Mensagem("Onde ninguem se atreveu a ir...");
                }
            }


            if (Game1.Jogador.Position != ponto3 && check1 == true && check2 == true && check3 == false)
            {
                Game1.Jogador.Position = Game1.Jogador.Position + Vector2.UnitX;
                Game1.Jogador.Position = Game1.Jogador.Position + Vector2.UnitY;
                if (Game1.Jogador.Position == ponto3 && check3 == false)
                {
                    check3 = true;
                    //FontSupport.Mensagem("Uma faca, uma escolha, uma aventura!");
                    Game1.Jogador.inCutscene = false;
                    FontSupport.Mensagem("");
                }
            }

            /*if RoomBoos{ Game1.Jogador.inCutscene = false,  Game1.Jogador.Position corre e grita }*/
        }
コード例 #2
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            if (Jogador.luz == false && Jogador.vida > 0)
            {
                GraphicsDevice.Clear(Color.Gray);
            }

            #region aviso dano

            if (Jogador.luz == true && Jogador.vida > 0)
            {
                var red   = Color.Black;
                var black = Color.Red;


                // Gives you a color at half the distance between red and green
                var color3 = Color.Lerp(red, black, 0.5f);
                GraphicsDevice.Clear(color3);

                if (espera > 0.5)
                {
                    espera = 0; Jogador.luz = false;
                }
            }
            #endregion

            // TODO: Add your drawing code here
            //spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, cam.Transform);
            //spriteBatch.Draw(t,p);
            #region desenha tela
            if (TelaMenu == true && Jogador.vida > 0)
            {
                KeyboardState k = Keyboard.GetState();

                spriteBatch.Begin(SpriteSortMode.Texture, null, null, null, null, null, null);
                spriteBatch.Draw(fundo, new Rectangle(0, 0, 800, 480), Color.White);
                FontSupport.PrintStatus(null);

                if (pass == 0)
                {
                    FontSupport.Mensagem("Novo Jogo");
                    if (k.IsKeyDown(Keys.Enter))
                    {
                        TelaMenu = false;
                        if (TelaMenu == false)
                        {
                            FontSupport.sStatusLocation = new Vector2(200, 200);
                            FontSupport.Mensagem(" ");
                        }
                    }
                }
                else if (pass == 1)
                {
                    FontSupport.sStatusLocation = new Vector2(100, 200);
                    FontSupport.Mensagem("Opcoes: \n\nF-FullScreen\nOn/off");
                }
                else if (pass == 2)
                {
                    FontSupport.sStatusLocation = new Vector2(200, 200);
                    FontSupport.Mensagem("Creditos");
                    if (k.IsKeyDown(Keys.Enter))
                    {
                        FontSupport.sStatusLocation = Vector2.One * 5;
                        FontSupport.Mensagem("\nJogo by: \n\nLucas Santos \n\nMoises Moreira \n\nVasco Figueiredo \n\n2017\nEdj-IPCA");
                    }
                }
                else if (pass == 3)
                {
                    FontSupport.sStatusLocation = new Vector2(200, 200);
                    FontSupport.Mensagem("Sair");

                    if (k.IsKeyDown(Keys.Enter))
                    {
                        Exit();
                    }
                    #endregion
                }
                spriteBatch.End();
            }



            if (TelaMenu == false && Jogador.vida > 0)
            {
                //spriteBatch.End();
                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, cam.get_transformation(GraphicsDevice));
                GerMapas.Draw();
                cam.get_transformation(GraphicsDevice);
                Jogador.Draw();

                //spriteBatch.Draw(teste, Vector2.Zero, Color.White);

                /*
                 * spriteBatch.Draw(
                 *  texture: shitLight,
                 *  position: Vector2.One * 2,
                 *  //color: new Color(
                 *  //    ((float)gameTime.TotalGameTime.TotalSeconds * 1.0f) % 1f,
                 *  //    ((float)gameTime.TotalGameTime.TotalSeconds * 2.0f) % 1f,
                 *  //    ((float)gameTime.TotalGameTime.TotalSeconds * 3.0f) % 1f,
                 *  //    1f),
                 *  color: Color.Black,
                 *  scale: new Vector2(10f),
                 *  origin: new Vector2(32));
                 */
                //TesteFogo.Draw(spriteBatch);


                foreach (Inimigo Ini in GerInimigos.listaInimigos)
                {
                    if (Ini.Isdead == false)
                    {
                        Ini.Draw(spriteBatch);
                    }
                    else
                    {
                        spriteBatch.Draw(Sangue, Ini.Position, Color.White);
                    }
                }

                foreach (Drop d in drops)
                {
                    d.Draw();
                }



                followPlayer = cam.centre;

                spriteBatch.End();
                spriteBatch.Begin(SpriteSortMode.Texture, null, null, null, null, null, null);
                FontSupport.PrintStatus(null);
                FontSupport.PrintCoins(null);
                UI.UiDraw(spriteBatch);
                spriteBatch.End();


                base.Draw(gameTime);
            }
            else if (Jogador.vida <= 0)
            {
                KeyboardState k = Keyboard.GetState();

                spriteBatch.Begin(SpriteSortMode.Texture, null, null, null, null, null, null);

                if (som == false)
                {
                    GraphicsDevice.Clear(Color.Gray);


                    som = true;
                }
                FontSupport.PrintStatus(null);
                FontSupport.sStatusLocation = new Vector2(200, 200);
                FontSupport.Mensagem("Ha!ha!ha!\nOjogo\nTerminou!");



                if (k.IsKeyDown(Keys.Enter))
                {
                    Exit();
                }
                spriteBatch.End();
            }
        }