コード例 #1
0
        /// <summary>
        /// Draw code of the program
        /// </summary>
        private void Draw()
        {
            window.Clear();

            Score.Draw(window);

            if (gameState == GameState.Ready)
            {
                window.Draw(readyText);
            }

            if (gameState == GameState.Lose)
            {
                window.Draw(gameOverText);
            }

            grid.Draw(window);
            pacman.Draw(window);
            blinky.Draw(window);
            inky.Draw(window);
            pinky.Draw(window);
            clyde.Draw(window);

            window.Display();
        }
コード例 #2
0
 //draws each of the four ghosts and adjust the image variation to what it should be
 public void GhostsDraw()
 {
     //The purpose of the Draw ghosts method is to loop through the ghosts calling their animate and then draw methods.
     foreach (Ghost ghost in allghosts)
     {
         ghost.animateddirection();
         ghost.Draw();
     }
 }
コード例 #3
0
ファイル: BattleField.cs プロジェクト: IDgtl/Pacman
 public void DrawGraphic()
 {
     using (var g = Graphics.FromImage(Background))
     {
         this.DrawBackGround(g);
         this.DrawInterior(g);
         this.DrawDots(g);
         pacman.Draw(g);
         pinky.Draw(g);
     }
 }