Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/GameLogic/Snap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ public void PlayerHit (int player)
_score[player]++;
//TODO: consider playing a sound here...
}
else if(player=>0 && player<_score.Length)
{
_score[player]--;
}

// stop the game...
_started = false;
Expand Down
17 changes: 17 additions & 0 deletions src/SnapGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ private static void HandleUserInput(Snap myGame)
{
myGame.FlipNextCard ();
}

if (myGame.IsStarted)
{
if( SwinGame.KeyTyped(KeyCode.vk_LSHIFT) &&
SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
{
//TODO: add sound effects
}
else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT))
{
myGame.PlayerHit(0);
}
else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
{
myGame.PlayerHit(1);
}
}
}

/// <summary>
Expand Down