Exemple #1
0
        // Draws all buttons, text, toolbox items and the map to the screen.
        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(tx2Background, Vector2.Zero, Color.White);
            DrawTextureToolBox(spriteBatch);
            MapEditGrid.DrawNodes(spriteBatch);

            for (int intButtonIndex = 0; intButtonIndex < 3; intButtonIndex++)
            {
                buttons[intButtonIndex].DrawButtonAndText(spriteBatch);
            }

            spriteBatch.DrawString(fontEditor, strMapName, new Vector2(0, 450), Color.AliceBlue);
            spriteBatch.DrawString(fontEditor, "Use keyboard to enter map name", new Vector2(0, 400), Color.AliceBlue);
            spriteBatch.Draw(tx2Outline, v2ToolBoxItems[intSelectedTexture / 4, intSelectedTexture % 4], Color.Black);
            visGrid.Draw(spriteBatch, MapEditGrid);
        }
Exemple #2
0
        // Draws all textures for players, shadow copies and map objects to the screen.
        public override void Draw(SpriteBatch spriteBatch)
        {
            layerGameGrid.DrawNodes(spriteBatch);

            int intHealthSpacing = 20; // Stores a value to space out player health text at the bottom of the screen.

            for (int intPlayerIndex = 0; intPlayerIndex <= 3; intPlayerIndex++)
            {
                if (player[intPlayerIndex].Dead != true)
                {
                    player[intPlayerIndex].Draw(spriteBatch);
                    spriteBatch.DrawString(fontGame, "Player" + intPlayerIndex + " : " + player[intPlayerIndex].Health, new Vector2(intHealthSpacing, 550), player[intPlayerIndex].Colour);
                    intHealthSpacing += 200;
                }
            }
            // Display the time remaining by subtracting the time progressed from the length of the game.
            spriteBatch.DrawString(fontGame, "Time Left: " + (100 - intProgressionTime), new Vector2(900, 550), Color.White);

            if (intProgressionTime > 5) // After 5 seconds, spawn shadow copies.
            {
                foreach (ShadowCopy shadowcopy in shadowCopy)
                {
                    if (shadowcopy != null)
                    {
                        shadowcopy.Draw(spriteBatch);                     // Draws each initial shadow copy.
                    }
                }
            }
            // Draws each shadow copy which has been instantiated.
            foreach (AddShadowCopy shadowcopy in addShadowCopy)
            {
                if (shadowcopy != null)
                {
                    shadowcopy.Draw(spriteBatch);
                }
            }
        }