Exemplo n.º 1
0
        public void Draw()
        {
            BG.Draw();
            Road.Draw();
            Obstacles.ForEach(o => o.Draw());
            Player.Draw();

            Foreground.Draw();

            if (Paused && !lost)
            {
                Util.DrawText("Press SPACE to jump!", new Vector2(150, 20));
            }

            if (lost)
            {
                if (highScore)
                {
                    Util.DrawText("NEW HIGH SCORE: " + score.ToString(), new Vector2(150, 20));
                }
                else
                {
                    Util.DrawText("Final score: " + score.ToString(), new Vector2(150, 20));
                }
            }

            DrawScore();
        }
Exemplo n.º 2
0
 //绘制游戏对象
 public void Draw(Graphics g)
 {
     BG.Draw(g);
     life.Draw(g);
     list_UI.Draw(g);
     if (boss_UI != null)
     {
         boss_UI.Draw(g);
     }
 }
Exemplo n.º 3
0
        public void Draw(SpriteBatch SBatch)
        {
            foreach (Sprite BG in HorizontalList)
            {
                BG.Draw(SBatch);
            }
            #region LaterCode

            /*foreach (Sprite BG in VerticalList)
             * {
             *  BG.Draw(SBatch);
             * }*/

            #endregion
        }
Exemplo n.º 4
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)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);
            spriteBatch.Begin();

            // All the sprites
            BG.Draw(spriteBatch, this.Content);
            if (MyGameControl.GameState == GameControl.Gstate.Game)
            {
                CurrentRoom.DrawRoom(spriteBatch, this.Content);
                //Door.Draw(spriteBatch, this.Content);
                MyGameControl.Draw(spriteBatch, this.Content);
                HUD1.DrawHUD(spriteBatch, this.Content);
                SettingsButton.Draw(spriteBatch, this.Content);

                if (CurrentRoom.getIntegerForm() == MyGameControl.MyMap.getWumpusRoom())
                {
                    MyGameControl.MyWumpus.Draw(spriteBatch, this.Content);
                }
            }
            else if (MyGameControl.GameState == GameControl.Gstate.Menu)
            {
                MyMenu.Draw(spriteBatch, this.Content);
            }

            // Debugging purposes: Text drawing
            DrawText();

            // And, of course, the cursor
            if (KBState.IsKeyDown(Keys.A))
            {
                CursorRight.AssetName = "ScreenPointers\\AnimatedCursor16";
                CursorRight.DrawAnimated(spriteBatch, this.Content);
            }
            else
            {
                CursorRight.AssetName = "ScreenPointers\\cursor2";
                CursorRight.Draw(spriteBatch, this.Content);
            }

            spriteBatch.End();
            base.Draw(gameTime);
        }
Exemplo n.º 5
0
 public void Draw(Graphics g)                         //绘制
 {
     BG.Draw(g);                                      //绘制背景
     PP.Draw(g);                                      //绘制玩家飞机
     for (int i = 0; i < listPlayerBullet.Count; i++) //把集合中的每一发子弹绘制出来
     {
         listPlayerBullet[i].Draw(g);
     }
     for (int i = 0; i < listplaneEnemies.Count; i++)//绘制敌人飞机
     {
         listplaneEnemies[i].Draw(g);
     }
     for (int i = 0; i < listenemyExplosions.Count; i++)//绘制敌人爆炸
     {
         listenemyExplosions[i].Draw(g);
     }
     for (int i = 0; i < listenemyBullets.Count; i++)//绘制敌人子弹
     {
         listenemyBullets[i].Draw(g);
     }
     for (int i = 0; i < listplayerExplosions.Count; i++)
     {
         listplayerExplosions[i].Draw(g);
     }
     DrawScore(g);//绘制分数
     for (int i = 0; i < listSupllies.Count; i++)
     {
         listSupllies[i].Draw(g);
     }
     for (int i = 0; i < listRocks.Count; i++)
     {
         listRocks[i].Draw(g);
     }
     for (int i = 0; i < listplayerSkill.Count; i++)
     {
         listplayerSkill[i].Draw(g);
     }
 }
Exemplo n.º 6
0
 public override void Draw(SpriteBatch spriteBatch)
 {
     BG.Draw(spriteBatch);
     mPlayer.Draw(spriteBatch);
 }
Exemplo n.º 7
0
 public void Draw(SpriteBatch spriteBatch)
 {
     BG.Draw(spriteBatch);
     spriteBatch.Draw(AssetManager.Sprites["Outline"], new Rectangle(64, 64, 192, 192), Color.White);
 }