예제 #1
0
        public void drawGameplay()
        {
            foundCount         = 0;
            totalTreasureTiles = 0;
            for (int y = 0; y < boardYDim; y++)
            {
                for (int x = 0; x < boardXDim; x++)
                {
                    if (board[y, x].isHighlighted)
                    {
                        totalTreasureTiles += 1;
                        if (board[y, x].isUserHighlighted || correctFillCooldown > 2)
                        {
                            board[y, x].drawCharacter(spriteBatch, Color.Cyan);
                            foundCount += 1;
                        }
                        else
                        {
                            if (isDebugEnabled)
                            {
                                board[y, x].drawCharacter(spriteBatch, selectedColor);
                            }
                            else
                            {
                                board[y, x].drawCharacter(spriteBatch);
                            }
                        }
                    }
                    else
                    {
                        if (board[y, x].isUserHighlighted && correctFillCooldown == 0)
                        {
                            board[y, x].drawCharacter(spriteBatch, Color.Green);
                        }
                        else
                        {
                            board[y, x].drawCharacter(spriteBatch);
                        }
                    }
                    if (isDebugEnabled)
                    {
                        spriteBatch.DrawString(testFont, "Y: " + y + "\nX: " + x,
                                               new Vector2(board[y, x].getRec().Center.X -
                                                           (board[y, x].getRec().Width / 4), board[y, x].getRec().Center.Y -
                                                           (board[y, x].getRec().Height / 3)), Color.Red);
                    }
                }
            }
            if (isDebugEnabled)
            {
                spriteBatch.DrawString(testFont, patternChoice.ToString(),
                                       new Vector2(10, 10), Color.Red);
            }

            if (shouldDrawTimesUsed)
            {
                for (int i = 0; i < (Enum.GetNames(typeof(tools)).Length); i++)
                {
                    timesUsedGraph[i].drawCharacter(spriteBatch, graphColors[i]);
                    spriteBatch.DrawString(testFont, ((tools)(i)).ToString(),
                                           new Vector2(timesUsedGraph[i].getRec().Center.X, timesUsedGraph[i].getRec().Bottom + 10)
                                           - testFont.MeasureString(((tools)(i)).ToString()) / 2, Color.CadetBlue);
                    //0, new Vector2(screenWidth / 2, 10), 1, SpriteEffects.None, 1);
                }
            }

            spriteBatch.DrawString(testFont, "Points to\nSpend: " + pointsToSpend.ToString(),
                                   new Vector2(0, 15), Color.Red);
            spriteBatch.DrawString(testFont, "  Tool:\n" + selectedTool.ToString(),
                                   new Vector2(5, 90), Color.Red);
        }