コード例 #1
0
        private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            for (int i = 0; i < kNumberOfShields; i++)
            {
                Shields[i].Draw(g);
            }

//			g.FillRectangle(Brushes.Black, 0, 0, ClientRectangle.Width, ClientRectangle.Height);
            TheMan.Draw(g);
            TheScore.Draw(g);
            TheHighScore.Draw(g);
            displayLives.Draw(g);
            if (ActiveBullet)
            {
                TheBullet.Draw(g);
            }

            if (SaucerStart)
            {
                CurrentSaucer.Draw(g);
            }

            for (int i = 0; i < kNumberOfRows; i++)
            {
                TheInvaders = InvaderRows[i];
                TheInvaders.Draw(g);
            }
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: FIN-18-20/Tests-Monogame
        /// <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);

            spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointWrap);
            _invadersWall.Draw(spriteBatch);
            _ship.Draw();
            if (_bullet.IsVisible)
            {
                _bullet.Draw(spriteBatch);
            }
            spriteBatch.End();

            base.Draw(gameTime);
        }