Пример #1
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.Black);

            // TODO: Add your drawing code here

            spriteBatch.Begin();


            //Rita spelaren
            player.Draw(spriteBatch);

            //Rita fiendena
            foreach (Enemy e in enemies)
            {
                e.Draw(spriteBatch);
            }

            // Rita texter
            // För att kunna skriva svenska tecken (åäöÅÄÖ) behöver man ändra lite i
            // XML-filen som hänger ihop med din font. Leta efter taggen <END>.
            // Ändra där värdet till exempelvis 255.
            printText.Print("Poäng:" + player.Points, spriteBatch, 0, 0);
            printText.Print("Antal fiender:" + enemies.Count, spriteBatch, 0, 20);

            //Rita guldmynt
            foreach (GoldCoin gc in goldCoins)
            {
                gc.Draw(spriteBatch);
            }
            spriteBatch.End();
            base.Draw(gameTime);
        }
Пример #2
0
        public static void RunDraw(SpriteBatch spriteBatch)
        {
            player.Draw(spriteBatch);

            foreach (Enemies e in enemies)
            {
                e.Draw(spriteBatch);
            }
            printText.Print("Enemies Left : " + enemies.Count, spriteBatch, 0, 0);

            foreach (GoldCoin gc in goldCoins)
            {
                gc.Draw(spriteBatch);
            }
            printText.Print("Points Obtained : " + player.Points, spriteBatch, 0, 20);
        }
Пример #3
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);

            // TODO: Add your drawing code here
            spriteBatch.Begin();
            player.Draw(spriteBatch);
            printText.Print("testutskrift", spriteBatch, 0, 0);
            spriteBatch.End();

            base.Draw(gameTime);
        }
Пример #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.TransparentBlack);
            //grafik
            spriteBatch.Begin();
            player.Draw(spriteBatch);
            foreach (Enemy e in enemies)
            {
                e.Draw(spriteBatch);
            }
            printText.Print("Test", spriteBatch, 0, 0);
            spriteBatch.End();

            base.Draw(gameTime);
        }
        public static void HighScoreDraw(SpriteBatch spriteBatch, GameWindow window)
        {
            background.Draw(spriteBatch);                               // Draw background

            printText.Print("***HIGHSCORES***", spriteBatch, 250, 100); // Draw title
            for (int i = 0; i < hs.hsItems.Count; i++)
            {
                string text = $"{i+1}. {hs.hsItems[i].Name} : {hs.hsItems[i].Points}p";  // Format a HSItem
                printText.Print(text, spriteBatch, 300, 165 + (i * 30));                 // Draw HSItem to screen
            }
        }
Пример #6
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            // TODO: Add your drawing code here
            _spriteBatch.Begin();
            player.Draw(_spriteBatch);
            foreach (Enemy e in enemies)
            {
                e.Draw(_spriteBatch);
            }
            foreach (GoldCoin gc in goldCoins)
            {
                gc.Draw(_spriteBatch);
            }

            printText.Print("Points:" + player.Points, _spriteBatch, 0, 0);
            _spriteBatch.End();

            base.Draw(gameTime);
        }