Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chagned font #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/SnapGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ namespace CardGames
{
public class SnapGame
{
public static void LoadResources()
{
Bitmap cards;
cards = SwinGame.LoadBitmapNamed ("Cards", "Cards.png");
SwinGame.BitmapSetCellDetails (cards, 82, 110, 13, 5, 53); // set the cells in the bitmap to match the cards
}
public static void LoadResources()
{
Bitmap cards;
cards = SwinGame.LoadBitmapNamed ("Cards", "Cards.png");
SwinGame.BitmapSetCellDetails (cards, 82, 110, 13, 5, 53);
SwinGame.LoadFontNamed ("GameFont", "arial.ttf", 12);
}

/// <summary>
/// Respond to the user input -- with requests affecting myGame
Expand All @@ -32,6 +33,9 @@ private static void HandleUserInput(Snap myGame)
/// 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);
Expand All @@ -40,9 +44,9 @@ private static void DrawGame(Snap myGame)
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.DrawText ("Top Card is " + top.ToString (), Color.RoyalBlue, "GameFont" ,0, 20);
SwinGame.DrawText ("Player 1 score: " + myGame.Score(0), Color.RoyalBlue, "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
Expand Down