Ejemplo n.º 1
0
        /// <summary>
        /// Draws the game to the Window.
        /// </summary>
        /// <param name="myGame">The details of the game -- mostly top card and scores.</param>
        private static void DrawGame(Snap myGame)
        {
            SwinGame.DrawBitmap("cardsBoard.png", 0, 0);

            // Draw the top card
            Card top = myGame.TopCard;

            if (top != null)
            {
                SwinGame.LoadFontNamed("GameFont", "Chunkfive.otf", 24);
                SwinGame.DrawText("Top Card is " + top.ToString(), Color.RoyalBlue, 0, 20);
                SwinGame.DrawText("Player 1 score: " + myGame.Score(0), Color.RoyalBlue, 0, 30);
                SwinGame.DrawText("Player 2 score: " + myGame.Score(1), Color.RoyalBlue, 0, 40);
                SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"),
                                  top.CardIndex, 521, 153);
                SwinGame.LoadSoundEffectNamed("Slap1", "slap1.wav");
                SwinGame.PlaySoundEffect("Slap1");
                SwinGame.DrawText("Player 1 score:" + myGame.Score(0), Color.Red, "GameFont", 0, 30);
                SwinGame.DrawText("Player 2 score: " + myGame.Score(1), Color.RoyalBlue, "GameFont", 0, 40);
                SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), top.CardIndex, 350, 50);
            }
            else
            {
                SwinGame.DrawText("No card played yet...", Color.RoyalBlue, 0, 20);
            }

            // Draw the back of the cards... to represent the deck
            SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), 52, 155, 153);
            SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), 52, 160, 50);
            SwinGame.LoadSoundEffectNamed("Slap2", "slap2.wav");
            SwinGame.PlaySoundEffect("Slap2");

            //Draw onto the screen
            SwinGame.RefreshScreen(60);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Draws the game to the Window.
        /// </summary>
        /// <param name="myGame">The details of the game -- mostly top card and scores.</param>
        private static void DrawGame(Snap myGame)
        {
            SwinGame.DrawBitmap("cardsBoard.png", 0, 0);

            // Draw the top card
            Card top = myGame.TopCard;

            if (top != null)
            {
                SwinGame.DrawText("Top Card is " + top.ToString(), Color.White, "GameFont", 0, 20);
                SwinGame.DrawText("Player 1 score: " + myGame.Score(0), Color.White, "GameFont", 0, 40);
                SwinGame.DrawText("Player 2 score: " + myGame.Score(1), Color.White, "GameFont", 0, 60);
                SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), top.CardIndex, 521, 153);
            }
            else
            {
                SwinGame.DrawText("No card played yet...", Color.RoyalBlue, 0, 20);
            }

            // Draw the back of the cards... to represent the deck
            SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), 52, 155, 153);

            //Draw onto the screen
            SwinGame.RefreshScreen(60);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Draws the game to the Window.
        /// </summary>
        /// <param name="myGame">The details of the game -- mostly top card and scores.</param>
        private static void DrawGame(Snap myGame)
        {
            //SwinGame.ClearScreen(Color.White);
            SwinGame.DrawBitmap("cardsBoard.png", 0, 0);

            //Load Chunkfive font
            SwinGame.LoadFontNamed("GameFont", "chunkfive.otf", 24);

            // Draw the top card
            Card top = myGame.TopCard;

            if (top != null)
            {
                SwinGame.DrawText("Top Card is " + top.ToString(), Color.WhiteSmoke, 0, 10);
                SwinGame.DrawText("" + myGame.Score(0), Color.White, "GameFont", 77, 52);
                SwinGame.DrawText("" + myGame.Score(1), Color.White, "GameFont", 769, 55);
                SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), top.CardIndex, 521, 153);
            }
            else
            {
                SwinGame.DrawText("No card played yet...", Color.WhiteSmoke, 0, 10);
            }

            // Draw the back of the cards... to represent the deck
            SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), 52, 155, 153);

            //Draw onto the screen
            SwinGame.RefreshScreen(60);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Draws the game to the Window.
        /// </summary>
        /// <param name="myGame">The details of the game -- mostly top card and scores.</param>
        private static void DrawGame(Snap myGame)
        {
            SwinGame.DrawBitmap("cardsBoard.png", 0, 0);

            SwinGame.LoadFontNamed("GameFont", "Chunk.otf", 24);
            SwinGame.LoadFontNamed("TopFont", "Chunk.otf", 32);
            SwinGame.LoadFontNamed("StartFont", "Chunk.otf", 24);

            // Draw the top card
            Card top = myGame.TopCard;

            if (top != null)
            {
                SwinGame.DrawText("Top Card is " + top.ToString(), Color.Red, "TopFont", 310, 105);
                SwinGame.DrawText("Player 1 score: " + myGame.Score(0), Color.White, "GameFont", 45, 40);
                SwinGame.DrawText("Player 2 score: " + myGame.Score(1), Color.White, "GameFont", 625, 40);
                SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), top.CardIndex, 565, 225);
            }
            else
            {
                SwinGame.DrawText("No card played yet...", Color.Red, "StartFont", 10, 10);
            }


            // Draw the back of the cards... to represent the deck
            SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), 52, 200, 230);

            //Draw onto the screen
            SwinGame.RefreshScreen(60);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Draws the game to the Window.
        /// </summary>
        /// <param name="myGame">The details of the game -- mostly top card and scores.</param>
        private static void DrawGame(Snap myGame)
        {
            SwinGame.ClearScreen(Color.White);
            SwinGame.DrawBitmap("cardsBoard.png", 0, 0);

            // Draw the top card
            Card top = myGame.TopCard;

            if (top != null)
            {
                SwinGame.DrawText("Top Card is " + top.ToString(), Color.RoyalBlue, 0, 20);
                SwinGame.DrawText("Player 1 score: " + myGame.Score(0), Color.RoyalBlue, 0, 30);
                SwinGame.DrawText("Player 2 score: " + myGame.Score(1), Color.RoyalBlue, 0, 40);
                SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), top.CardIndex, 565, 226);
                SwinGame.DrawText("" + myGame.Score(0), Color.White, "GameFont", 75, 50);                 // let the score color become white//
                SwinGame.DrawText("" + myGame.Score(1), Color.White, "GameFont", 765, 55);
            }
            else
            {
                SwinGame.DrawText("No card played yet...", Color.RoyalBlue, 0, 20);
            }
            SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), 52, 200, 225);

            // Draw the back of the cards... to represent the deck


            //Draw onto the screen
            SwinGame.RefreshScreen(60);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Draws the game to the Window.
        /// </summary>
        /// <param name="myGame">The details of the game -- mostly top card and scores.</param>
        private static void DrawGame(Snap myGame)
        {
            SwinGame.ClearScreen(Color.White);

            // Draw the top card
            Card top = myGame.TopCard;

            if (top != null)
            {
                SwinGame.DrawText("Top Card is " + top.ToString(), Color.RoyalBlue, Chunkfive, 0, 20);
                SwinGame.DrawText("Player 1 score: " + myGame.Score(0), Color.RoyalBlue, Chunkfive, 0, 30);
                SwinGame.DrawText("Player 2 score: " + myGame.Score(1), Color.RoyalBlue, Chunkfive, 0, 40);
                SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), top.CardIndex, 350, 50);
            }
            else
            {
                SwinGame.DrawText("No card played yet...", Color.RoyalBlue, 0, 20);
            }

            // Draw the back of the cards... to represent the deck
            SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), 52, 160, 50);

            //Draw onto the screen
            SwinGame.RefreshScreen(60);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Draws the game to the Window.
        /// </summary>
        /// <param name="myGame">The details of the game -- mostly top card and scores.</param>
        private static void DrawGame(Snap myGame)
        {
            SwinGame.DrawBitmap("cardsBoard.png", 0, 0);
            //SwinGame.ClearScreen(Color.White);
            //SwinGame.PlaySoundEffect("Start");
            // Draw the top card
            Card top = myGame.TopCard;

            if (top != null)
            {
                SwinGame.DrawText("Top Card is " + top.ToString(), Color.White, 340, 120);
                //SwinGame.DrawText ("Player 1 score: " + myGame.Score(0), Color.White, 130, 30);
                //SwinGame.DrawText ("Player 2 score: " + myGame.Score(1), Color.White, 130, 40);

                SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), top.CardIndex, 570, 220);

                SwinGame.DrawText("" + myGame.Score(0), Color.White, "GameFont", 70, 50);
                SwinGame.DrawText("" + myGame.Score(1), Color.White, "GameFont", 758, 50);
            }
            else
            {
                SwinGame.DrawText("Hit space to start ...", Color.WhiteSmoke, 340, 120);
            }

            // Draw the back of the cards... to represent the deck
            SwinGame.DrawCell(SwinGame.BitmapNamed("Cards"), 52, 200, 220);

            //Draw onto the screen
            SwinGame.RefreshScreen(60);
        }