Exemplo n.º 1
0
        // Fonction Draw : Cette fonction ne fait qu'afficher le score, ainsi que les blocs.
        // Paramètre : RenderWindow window : Il s'agit du rendu visuel de la fenêtre de l'application.
        // Visibilité : publique
        // Aucune valeur de retour.

        public void Draw(RenderWindow window)
        {
            // Affichage du pointage
            text.DisplayedString = string.Format("Score: {0}", currentScore);
            window.Draw(text);

            activeBlock.Draw(window);

            //Boucle imbriquée qui colorie les blocs en gelés en blanc.
            for (int i = 0; i < NB_ROWS; i++)
            {
                for (int j = 0; j < NB_COLUMNS; j++)
                {
                    if (logicalGameBoard[i, j] == false)
                    {
                        TetrominoLittleBlock temp = new TetrominoLittleBlock(j, i, Color.White);
                        temp.Draw(window, 0, 0);
                    }
                }
            }
            // ppoulin
            // Ce n'est pas l'endroit pour appeler cette méthode.
            // Il faut respecter la sémantique du nom.  La méthode est responsable d'afficher (Draw)
            // pas de mettre à jour.
            // CIC-3
            UpdateGame();
        }
Exemplo n.º 2
0
 //Fonction Draw : Cette méthode va dessiner le sprite à la position en colonne et rangée (en prenant compte des décalages
 //                topLeftColumnOffset et topLeftRowOffset) des petits blocs du tetrominos.
 //Paramètres rentrés : - RenderWindow window : Il s'agit du rendu visuel de la fenêtre de l'application.
 //Visibilité : publique
 //
 //Aucune valeur de retour
 public void Draw(RenderWindow window)
 {
     b1.Draw(window, topLeftRowOffset, topLeftColumnOffset);
     b2.Draw(window, topLeftRowOffset, topLeftColumnOffset);
     b3.Draw(window, topLeftRowOffset, topLeftColumnOffset);
     b4.Draw(window, topLeftRowOffset, topLeftColumnOffset);
 }