commit 960f64799add8736c00a8bdc69b8596586edf8cc Author: melaranc Date: Sat Jan 27 21:47:41 2024 -0800 Initial commit for gitea archival. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1995993 --- /dev/null +++ b/.gitignore @@ -0,0 +1,100 @@ +# Build Folders (you can keep bin if you'd like, to store dlls and pdbs) +[Bb]in/ +[Oo]bj/ + +# mstest test results +TestResults + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +x64/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.log +*.vspscc +*.vssscc +.builds + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper* + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress + +# Click-Once directory +publish + +# Publish Web Output +*.Publish.xml + +# NuGet Packages Directory +packages + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +[Bb]in +[Oo]bj +sql +TestResults +[Tt]est[Rr]esult* +*.Cache +ClientBin +[Ss]tyle[Cc]op.* +~$* +*.dbmdl + +#added for RIA/Silverlight projects +Generated_Code + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML \ No newline at end of file diff --git a/Assets/Bicycle Rider Backs.jpg b/Assets/Bicycle Rider Backs.jpg new file mode 100644 index 0000000..c5b3a43 Binary files /dev/null and b/Assets/Bicycle Rider Backs.jpg differ diff --git a/Assets/Cards/Card_Back.png b/Assets/Cards/Card_Back.png new file mode 100644 index 0000000..2a77ac1 Binary files /dev/null and b/Assets/Cards/Card_Back.png differ diff --git a/Assets/Cards/Club_Ace.png b/Assets/Cards/Club_Ace.png new file mode 100644 index 0000000..babcecc Binary files /dev/null and b/Assets/Cards/Club_Ace.png differ diff --git a/Assets/Cards/Club_Eight.png b/Assets/Cards/Club_Eight.png new file mode 100644 index 0000000..ddff2ee Binary files /dev/null and b/Assets/Cards/Club_Eight.png differ diff --git a/Assets/Cards/Club_Five.png b/Assets/Cards/Club_Five.png new file mode 100644 index 0000000..f8fd50f Binary files /dev/null and b/Assets/Cards/Club_Five.png differ diff --git a/Assets/Cards/Club_Four.png b/Assets/Cards/Club_Four.png new file mode 100644 index 0000000..068d998 Binary files /dev/null and b/Assets/Cards/Club_Four.png differ diff --git a/Assets/Cards/Club_Jack.png b/Assets/Cards/Club_Jack.png new file mode 100644 index 0000000..cb3168c Binary files /dev/null and b/Assets/Cards/Club_Jack.png differ diff --git a/Assets/Cards/Club_King.png b/Assets/Cards/Club_King.png new file mode 100644 index 0000000..77704ad Binary files /dev/null and b/Assets/Cards/Club_King.png differ diff --git a/Assets/Cards/Club_Nine.png b/Assets/Cards/Club_Nine.png new file mode 100644 index 0000000..91b3a00 Binary files /dev/null and b/Assets/Cards/Club_Nine.png differ diff --git a/Assets/Cards/Club_Queen.png b/Assets/Cards/Club_Queen.png new file mode 100644 index 0000000..c2b9163 Binary files /dev/null and b/Assets/Cards/Club_Queen.png differ diff --git a/Assets/Cards/Club_Seven.png b/Assets/Cards/Club_Seven.png new file mode 100644 index 0000000..912c0a6 Binary files /dev/null and b/Assets/Cards/Club_Seven.png differ diff --git a/Assets/Cards/Club_Six.png b/Assets/Cards/Club_Six.png new file mode 100644 index 0000000..473c07e Binary files /dev/null and b/Assets/Cards/Club_Six.png differ diff --git a/Assets/Cards/Club_Ten.png b/Assets/Cards/Club_Ten.png new file mode 100644 index 0000000..1ebfeb6 Binary files /dev/null and b/Assets/Cards/Club_Ten.png differ diff --git a/Assets/Cards/Club_Three.png b/Assets/Cards/Club_Three.png new file mode 100644 index 0000000..d469da0 Binary files /dev/null and b/Assets/Cards/Club_Three.png differ diff --git a/Assets/Cards/Club_Two.png b/Assets/Cards/Club_Two.png new file mode 100644 index 0000000..398b35f Binary files /dev/null and b/Assets/Cards/Club_Two.png differ diff --git a/Assets/Cards/Diamond_Ace.png b/Assets/Cards/Diamond_Ace.png new file mode 100644 index 0000000..1b37195 Binary files /dev/null and b/Assets/Cards/Diamond_Ace.png differ diff --git a/Assets/Cards/Diamond_Eight.png b/Assets/Cards/Diamond_Eight.png new file mode 100644 index 0000000..2dc38d1 Binary files /dev/null and b/Assets/Cards/Diamond_Eight.png differ diff --git a/Assets/Cards/Diamond_Five.png b/Assets/Cards/Diamond_Five.png new file mode 100644 index 0000000..e81d788 Binary files /dev/null and b/Assets/Cards/Diamond_Five.png differ diff --git a/Assets/Cards/Diamond_Four.png b/Assets/Cards/Diamond_Four.png new file mode 100644 index 0000000..f6ad5d2 Binary files /dev/null and b/Assets/Cards/Diamond_Four.png differ diff --git a/Assets/Cards/Diamond_Jack.png b/Assets/Cards/Diamond_Jack.png new file mode 100644 index 0000000..e38201e Binary files /dev/null and b/Assets/Cards/Diamond_Jack.png differ diff --git a/Assets/Cards/Diamond_King.png b/Assets/Cards/Diamond_King.png new file mode 100644 index 0000000..f4972ae Binary files /dev/null and b/Assets/Cards/Diamond_King.png differ diff --git a/Assets/Cards/Diamond_Nine.png b/Assets/Cards/Diamond_Nine.png new file mode 100644 index 0000000..ff93da1 Binary files /dev/null and b/Assets/Cards/Diamond_Nine.png differ diff --git a/Assets/Cards/Diamond_Queen.png b/Assets/Cards/Diamond_Queen.png new file mode 100644 index 0000000..b545914 Binary files /dev/null and b/Assets/Cards/Diamond_Queen.png differ diff --git a/Assets/Cards/Diamond_Seven.png b/Assets/Cards/Diamond_Seven.png new file mode 100644 index 0000000..7bd01b8 Binary files /dev/null and b/Assets/Cards/Diamond_Seven.png differ diff --git a/Assets/Cards/Diamond_Six.png b/Assets/Cards/Diamond_Six.png new file mode 100644 index 0000000..275ceca Binary files /dev/null and b/Assets/Cards/Diamond_Six.png differ diff --git a/Assets/Cards/Diamond_Ten.png b/Assets/Cards/Diamond_Ten.png new file mode 100644 index 0000000..0cc4a97 Binary files /dev/null and b/Assets/Cards/Diamond_Ten.png differ diff --git a/Assets/Cards/Diamond_Three.png b/Assets/Cards/Diamond_Three.png new file mode 100644 index 0000000..41222c7 Binary files /dev/null and b/Assets/Cards/Diamond_Three.png differ diff --git a/Assets/Cards/Diamond_Two.png b/Assets/Cards/Diamond_Two.png new file mode 100644 index 0000000..077e38b Binary files /dev/null and b/Assets/Cards/Diamond_Two.png differ diff --git a/Assets/Cards/Heart_Ten.png b/Assets/Cards/Heart_Ten.png new file mode 100644 index 0000000..7fc2ddb Binary files /dev/null and b/Assets/Cards/Heart_Ten.png differ diff --git a/Assets/Cards/Hearts_Ace.png b/Assets/Cards/Hearts_Ace.png new file mode 100644 index 0000000..f42d24b Binary files /dev/null and b/Assets/Cards/Hearts_Ace.png differ diff --git a/Assets/Cards/Hearts_Eight.png b/Assets/Cards/Hearts_Eight.png new file mode 100644 index 0000000..a9ebf83 Binary files /dev/null and b/Assets/Cards/Hearts_Eight.png differ diff --git a/Assets/Cards/Hearts_Five.png b/Assets/Cards/Hearts_Five.png new file mode 100644 index 0000000..4e43c07 Binary files /dev/null and b/Assets/Cards/Hearts_Five.png differ diff --git a/Assets/Cards/Hearts_Four.png b/Assets/Cards/Hearts_Four.png new file mode 100644 index 0000000..54cd453 Binary files /dev/null and b/Assets/Cards/Hearts_Four.png differ diff --git a/Assets/Cards/Hearts_Jack.png b/Assets/Cards/Hearts_Jack.png new file mode 100644 index 0000000..a770783 Binary files /dev/null and b/Assets/Cards/Hearts_Jack.png differ diff --git a/Assets/Cards/Hearts_King.png b/Assets/Cards/Hearts_King.png new file mode 100644 index 0000000..6ead4fd Binary files /dev/null and b/Assets/Cards/Hearts_King.png differ diff --git a/Assets/Cards/Hearts_Nine.png b/Assets/Cards/Hearts_Nine.png new file mode 100644 index 0000000..1a91a70 Binary files /dev/null and b/Assets/Cards/Hearts_Nine.png differ diff --git a/Assets/Cards/Hearts_Queen.png b/Assets/Cards/Hearts_Queen.png new file mode 100644 index 0000000..9f4305f Binary files /dev/null and b/Assets/Cards/Hearts_Queen.png differ diff --git a/Assets/Cards/Hearts_Seven.png b/Assets/Cards/Hearts_Seven.png new file mode 100644 index 0000000..fd88fa0 Binary files /dev/null and b/Assets/Cards/Hearts_Seven.png differ diff --git a/Assets/Cards/Hearts_Six.png b/Assets/Cards/Hearts_Six.png new file mode 100644 index 0000000..c48d95f Binary files /dev/null and b/Assets/Cards/Hearts_Six.png differ diff --git a/Assets/Cards/Hearts_Three.png b/Assets/Cards/Hearts_Three.png new file mode 100644 index 0000000..6c57cf5 Binary files /dev/null and b/Assets/Cards/Hearts_Three.png differ diff --git a/Assets/Cards/Hearts_Two.png b/Assets/Cards/Hearts_Two.png new file mode 100644 index 0000000..b8c25f0 Binary files /dev/null and b/Assets/Cards/Hearts_Two.png differ diff --git a/Assets/Cards/Spade_Ace.png b/Assets/Cards/Spade_Ace.png new file mode 100644 index 0000000..6ba0d9b Binary files /dev/null and b/Assets/Cards/Spade_Ace.png differ diff --git a/Assets/Cards/Spade_Eight.png b/Assets/Cards/Spade_Eight.png new file mode 100644 index 0000000..7ea31a2 Binary files /dev/null and b/Assets/Cards/Spade_Eight.png differ diff --git a/Assets/Cards/Spade_Five.png b/Assets/Cards/Spade_Five.png new file mode 100644 index 0000000..fc3d6a5 Binary files /dev/null and b/Assets/Cards/Spade_Five.png differ diff --git a/Assets/Cards/Spade_Four.png b/Assets/Cards/Spade_Four.png new file mode 100644 index 0000000..eee21aa Binary files /dev/null and b/Assets/Cards/Spade_Four.png differ diff --git a/Assets/Cards/Spade_Jack.png b/Assets/Cards/Spade_Jack.png new file mode 100644 index 0000000..e076e86 Binary files /dev/null and b/Assets/Cards/Spade_Jack.png differ diff --git a/Assets/Cards/Spade_King.png b/Assets/Cards/Spade_King.png new file mode 100644 index 0000000..f0dc878 Binary files /dev/null and b/Assets/Cards/Spade_King.png differ diff --git a/Assets/Cards/Spade_Nine.png b/Assets/Cards/Spade_Nine.png new file mode 100644 index 0000000..05bf854 Binary files /dev/null and b/Assets/Cards/Spade_Nine.png differ diff --git a/Assets/Cards/Spade_Queen.png b/Assets/Cards/Spade_Queen.png new file mode 100644 index 0000000..7a17cae Binary files /dev/null and b/Assets/Cards/Spade_Queen.png differ diff --git a/Assets/Cards/Spade_Seven.png b/Assets/Cards/Spade_Seven.png new file mode 100644 index 0000000..f0c869d Binary files /dev/null and b/Assets/Cards/Spade_Seven.png differ diff --git a/Assets/Cards/Spade_Six.png b/Assets/Cards/Spade_Six.png new file mode 100644 index 0000000..5d7df03 Binary files /dev/null and b/Assets/Cards/Spade_Six.png differ diff --git a/Assets/Cards/Spade_Ten.png b/Assets/Cards/Spade_Ten.png new file mode 100644 index 0000000..d9e6b57 Binary files /dev/null and b/Assets/Cards/Spade_Ten.png differ diff --git a/Assets/Cards/Spade_Three.png b/Assets/Cards/Spade_Three.png new file mode 100644 index 0000000..ae5d8e6 Binary files /dev/null and b/Assets/Cards/Spade_Three.png differ diff --git a/Assets/Cards/Spade_Two.png b/Assets/Cards/Spade_Two.png new file mode 100644 index 0000000..8b1c387 Binary files /dev/null and b/Assets/Cards/Spade_Two.png differ diff --git a/Assets/GameBG.png b/Assets/GameBG.png new file mode 100644 index 0000000..7f5d77d Binary files /dev/null and b/Assets/GameBG.png differ diff --git a/Assets/POL-cyber-soldier-short.wav b/Assets/POL-cyber-soldier-short.wav new file mode 100644 index 0000000..0fed8cf Binary files /dev/null and b/Assets/POL-cyber-soldier-short.wav differ diff --git a/Assets/Splash Screen.psd b/Assets/Splash Screen.psd new file mode 100644 index 0000000..1d105b7 Binary files /dev/null and b/Assets/Splash Screen.psd differ diff --git a/Assets/bg_splash.png b/Assets/bg_splash.png new file mode 100644 index 0000000..0b2deff Binary files /dev/null and b/Assets/bg_splash.png differ diff --git a/Assets/blackjack_logo.png b/Assets/blackjack_logo.png new file mode 100644 index 0000000..8ac908c Binary files /dev/null and b/Assets/blackjack_logo.png differ diff --git a/Assets/button_deal_hover.png b/Assets/button_deal_hover.png new file mode 100644 index 0000000..af4f1ab Binary files /dev/null and b/Assets/button_deal_hover.png differ diff --git a/Assets/button_deal_normal.png b/Assets/button_deal_normal.png new file mode 100644 index 0000000..dbd8779 Binary files /dev/null and b/Assets/button_deal_normal.png differ diff --git a/Assets/button_hit_hover.png b/Assets/button_hit_hover.png new file mode 100644 index 0000000..c7dc6af Binary files /dev/null and b/Assets/button_hit_hover.png differ diff --git a/Assets/button_hit_normal.png b/Assets/button_hit_normal.png new file mode 100644 index 0000000..3a2f62c Binary files /dev/null and b/Assets/button_hit_normal.png differ diff --git a/Assets/button_stay_hover.png b/Assets/button_stay_hover.png new file mode 100644 index 0000000..ea9c0d5 Binary files /dev/null and b/Assets/button_stay_hover.png differ diff --git a/Assets/button_stay_normal.png b/Assets/button_stay_normal.png new file mode 100644 index 0000000..54e480b Binary files /dev/null and b/Assets/button_stay_normal.png differ diff --git a/Assets/card_deck.png b/Assets/card_deck.png new file mode 100644 index 0000000..9fa1351 Binary files /dev/null and b/Assets/card_deck.png differ diff --git a/Assets/cybersoldier.wav b/Assets/cybersoldier.wav new file mode 100644 index 0000000..9acc6bb Binary files /dev/null and b/Assets/cybersoldier.wav differ diff --git a/Assets/game_bgm.wav b/Assets/game_bgm.wav new file mode 100644 index 0000000..8dfb629 Binary files /dev/null and b/Assets/game_bgm.wav differ diff --git a/Assets/game_bgm2.wav b/Assets/game_bgm2.wav new file mode 100644 index 0000000..766fbbe Binary files /dev/null and b/Assets/game_bgm2.wav differ diff --git a/Assets/press_enter_to_start.png b/Assets/press_enter_to_start.png new file mode 100644 index 0000000..7147725 Binary files /dev/null and b/Assets/press_enter_to_start.png differ diff --git a/Assets/rock_texture.jpg b/Assets/rock_texture.jpg new file mode 100644 index 0000000..e11b42c Binary files /dev/null and b/Assets/rock_texture.jpg differ diff --git a/Assets/scoreboard_bg.png b/Assets/scoreboard_bg.png new file mode 100644 index 0000000..9309125 Binary files /dev/null and b/Assets/scoreboard_bg.png differ diff --git a/Assets/status_blackjack.png b/Assets/status_blackjack.png new file mode 100644 index 0000000..885bd82 Binary files /dev/null and b/Assets/status_blackjack.png differ diff --git a/Assets/status_busted.png b/Assets/status_busted.png new file mode 100644 index 0000000..2dabfdf Binary files /dev/null and b/Assets/status_busted.png differ diff --git a/Assets/status_stay.png b/Assets/status_stay.png new file mode 100644 index 0000000..a43addb Binary files /dev/null and b/Assets/status_stay.png differ diff --git a/Blackjack.sln b/Blackjack.sln new file mode 100644 index 0000000..9d4b692 --- /dev/null +++ b/Blackjack.sln @@ -0,0 +1,24 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blackjack", "Blackjack\Blackjack\Blackjack.csproj", "{8BCC83D7-5697-4282-8755-BA157E7BDB86}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlackjackContent", "Blackjack\BlackjackContent\BlackjackContent.contentproj", "{53A91419-7407-4ADC-B67C-715C2B6B120C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8BCC83D7-5697-4282-8755-BA157E7BDB86}.Debug|x86.ActiveCfg = Debug|x86 + {8BCC83D7-5697-4282-8755-BA157E7BDB86}.Debug|x86.Build.0 = Debug|x86 + {8BCC83D7-5697-4282-8755-BA157E7BDB86}.Release|x86.ActiveCfg = Release|x86 + {8BCC83D7-5697-4282-8755-BA157E7BDB86}.Release|x86.Build.0 = Release|x86 + {53A91419-7407-4ADC-B67C-715C2B6B120C}.Debug|x86.ActiveCfg = Debug|x86 + {53A91419-7407-4ADC-B67C-715C2B6B120C}.Release|x86.ActiveCfg = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Blackjack/Blackjack/Blackjack.csproj b/Blackjack/Blackjack/Blackjack.csproj new file mode 100644 index 0000000..974456f --- /dev/null +++ b/Blackjack/Blackjack/Blackjack.csproj @@ -0,0 +1,169 @@ + + + + {8BCC83D7-5697-4282-8755-BA157E7BDB86} + {6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Debug + x86 + WinExe + Properties + Blackjack + Blackjack + v4.0 + Client + v4.0 + Windows + HiDef + 418aa78c-6435-4a5b-b98a-67118a1d19da + Game + Game.ico + GameThumbnail.png + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\x86\Debug + DEBUG;TRACE;WINDOWS + prompt + 4 + true + false + x86 + False + + + pdbonly + true + bin\x86\Release + TRACE;WINDOWS + prompt + 4 + true + false + x86 + true + + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + + + + + + + + + + + + + + + + + + + + AIProjectContent + Content + + + + + False + Microsoft .NET Framework 4 Client Profile %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + False + Microsoft XNA Framework Redistributable 4.0 + true + + + + + + \ No newline at end of file diff --git a/Blackjack/Blackjack/CardData.cs b/Blackjack/Blackjack/CardData.cs new file mode 100644 index 0000000..559205f --- /dev/null +++ b/Blackjack/Blackjack/CardData.cs @@ -0,0 +1,231 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.GamerServices; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Media; + +namespace Blackjack { + + public enum CardFace { + Up, + Down + } + + public enum CardSuit{ + Null, + Heart, + Diamond, + Spade, + Club + } + + public enum CardLabel { + Null, + Ace, + Two, + Three, + Four, + Five, + Six, + Seven, + Eight, + Nine, + Ten, + Jack, + Queen, + King + } + + class CardData { + + private CardFace _CardFacePosition = CardFace.Down; + + public CardFace CardFacePosition { + get { return _CardFacePosition; } + set { _CardFacePosition = value; } + } + + + private CardLabel _cardlabel = CardLabel.Null; + + public CardLabel CardLabel { + get { return _cardlabel; } + set { _cardlabel = value; } + } + + private CardSuit _mysuit = CardSuit.Null; + + public CardSuit CardSuit { + get { return _mysuit; } + set { _mysuit = value; } + } + + public CardData(CardLabel cardvalue, CardSuit suit, CardFace pos) { + CardLabel = cardvalue; + CardSuit = suit; + CardFacePosition = pos; + } + + public Texture2D getCardTexture() { + if (CardFacePosition == CardFace.Up) { + if (CardLabel == Blackjack.CardLabel.Ace) { + if (CardSuit == Blackjack.CardSuit.Club) + return CardTextures.Club_Ace; + else if (CardSuit == Blackjack.CardSuit.Diamond) + return CardTextures.Diamond_Ace; + else if (CardSuit == Blackjack.CardSuit.Heart) + return CardTextures.Hearts_Ace; + else if (CardSuit == Blackjack.CardSuit.Spade) + return CardTextures.Spade_Ace; + } else if (CardLabel == Blackjack.CardLabel.Two) { + if (CardSuit == Blackjack.CardSuit.Club) + return CardTextures.Club_Two; + else if (CardSuit == Blackjack.CardSuit.Diamond) + return CardTextures.Diamond_Two; + else if (CardSuit == Blackjack.CardSuit.Heart) + return CardTextures.Hearts_Two; + else if (CardSuit == Blackjack.CardSuit.Spade) + return CardTextures.Spade_Two; + } else if (CardLabel == Blackjack.CardLabel.Three) { + if (CardSuit == Blackjack.CardSuit.Club) + return CardTextures.Club_Three; + else if (CardSuit == Blackjack.CardSuit.Diamond) + return CardTextures.Diamond_Three; + else if (CardSuit == Blackjack.CardSuit.Heart) + return CardTextures.Hearts_Three; + else if (CardSuit == Blackjack.CardSuit.Spade) + return CardTextures.Spade_Three; + } else if (CardLabel == Blackjack.CardLabel.Four) { + if (CardSuit == Blackjack.CardSuit.Club) + return CardTextures.Club_Four; + else if (CardSuit == Blackjack.CardSuit.Diamond) + return CardTextures.Diamond_Four; + else if (CardSuit == Blackjack.CardSuit.Heart) + return CardTextures.Hearts_Four; + else if (CardSuit == Blackjack.CardSuit.Spade) + return CardTextures.Spade_Four; + } else if (CardLabel == Blackjack.CardLabel.Five) { + if (CardSuit == Blackjack.CardSuit.Club) + return CardTextures.Club_Five; + else if (CardSuit == Blackjack.CardSuit.Diamond) + return CardTextures.Diamond_Five; + else if (CardSuit == Blackjack.CardSuit.Heart) + return CardTextures.Hearts_Five; + else if (CardSuit == Blackjack.CardSuit.Spade) + return CardTextures.Spade_Five; + } else if (CardLabel == Blackjack.CardLabel.Six) { + if (CardSuit == Blackjack.CardSuit.Club) + return CardTextures.Club_Six; + else if (CardSuit == Blackjack.CardSuit.Diamond) + return CardTextures.Diamond_Six; + else if (CardSuit == Blackjack.CardSuit.Heart) + return CardTextures.Hearts_Six; + else if (CardSuit == Blackjack.CardSuit.Spade) + return CardTextures.Spade_Six; + } else if (CardLabel == Blackjack.CardLabel.Seven) { + if (CardSuit == Blackjack.CardSuit.Club) + return CardTextures.Club_Seven; + else if (CardSuit == Blackjack.CardSuit.Diamond) + return CardTextures.Diamond_Seven; + else if (CardSuit == Blackjack.CardSuit.Heart) + return CardTextures.Hearts_Seven; + else if (CardSuit == Blackjack.CardSuit.Spade) + return CardTextures.Spade_Seven; + } else if (CardLabel == Blackjack.CardLabel.Eight) { + if (CardSuit == Blackjack.CardSuit.Club) + return CardTextures.Club_Eight; + else if (CardSuit == Blackjack.CardSuit.Diamond) + return CardTextures.Diamond_Eight; + else if (CardSuit == Blackjack.CardSuit.Heart) + return CardTextures.Hearts_Eight; + else if (CardSuit == Blackjack.CardSuit.Spade) + return CardTextures.Spade_Eight; + } else if (CardLabel == Blackjack.CardLabel.Nine) { + if (CardSuit == Blackjack.CardSuit.Club) + return CardTextures.Club_Nine; + else if (CardSuit == Blackjack.CardSuit.Diamond) + return CardTextures.Diamond_Nine; + else if (CardSuit == Blackjack.CardSuit.Heart) + return CardTextures.Hearts_Nine; + else if (CardSuit == Blackjack.CardSuit.Spade) + return CardTextures.Spade_Nine; + } else if (CardLabel == Blackjack.CardLabel.Ten) { + if (CardSuit == Blackjack.CardSuit.Club) + return CardTextures.Club_Ten; + else if (CardSuit == Blackjack.CardSuit.Diamond) + return CardTextures.Diamond_Ten; + else if (CardSuit == Blackjack.CardSuit.Heart) + return CardTextures.Hearts_Ten; + else if (CardSuit == Blackjack.CardSuit.Spade) + return CardTextures.Spade_Ten; + } else if (CardLabel == Blackjack.CardLabel.Jack) { + if (CardSuit == Blackjack.CardSuit.Club) + return CardTextures.Club_Jack; + else if (CardSuit == Blackjack.CardSuit.Diamond) + return CardTextures.Diamond_Jack; + else if (CardSuit == Blackjack.CardSuit.Heart) + return CardTextures.Hearts_Jack; + else if (CardSuit == Blackjack.CardSuit.Spade) + return CardTextures.Spade_Jack; + } else if (CardLabel == Blackjack.CardLabel.Queen) { + if (CardSuit == Blackjack.CardSuit.Club) + return CardTextures.Club_Queen; + else if (CardSuit == Blackjack.CardSuit.Diamond) + return CardTextures.Diamond_Queen; + else if (CardSuit == Blackjack.CardSuit.Heart) + return CardTextures.Hearts_Queen; + else if (CardSuit == Blackjack.CardSuit.Spade) + return CardTextures.Spade_Queen; + } else if (CardLabel == Blackjack.CardLabel.King) { + if (CardSuit == Blackjack.CardSuit.Club) + return CardTextures.Club_King; + else if (CardSuit == Blackjack.CardSuit.Diamond) + return CardTextures.Diamond_King; + else if (CardSuit == Blackjack.CardSuit.Heart) + return CardTextures.Hearts_King; + else if (CardSuit == Blackjack.CardSuit.Spade) + return CardTextures.Spade_King; + } + } else + return CardTextures.Card_Back; + return null; + } + + public int getCardValue() { + switch (CardLabel) { + case Blackjack.CardLabel.Ace: + return 1; + case Blackjack.CardLabel.Two: + return 2; + case Blackjack.CardLabel.Three: + return 3; + case Blackjack.CardLabel.Four: + return 4; + case Blackjack.CardLabel.Five: + return 5; + case Blackjack.CardLabel.Six: + return 6; + case Blackjack.CardLabel.Seven: + return 7; + case Blackjack.CardLabel.Eight: + return 8; + case Blackjack.CardLabel.Nine: + return 9; + case Blackjack.CardLabel.Ten: + case Blackjack.CardLabel.Jack: + case Blackjack.CardLabel.Queen: + case Blackjack.CardLabel.King: + return 10; + } + return -1; + } + + } + +} diff --git a/Blackjack/Blackjack/CardDeck.cs b/Blackjack/Blackjack/CardDeck.cs new file mode 100644 index 0000000..bc9d787 --- /dev/null +++ b/Blackjack/Blackjack/CardDeck.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Blackjack { + + class CardDeck { + + Random rd = new Random(); + public List Deck = new List(); + + public CardDeck() { + restoreDeck(); + shuffleDeck(); + } + + public void restoreDeck() { + Deck.Clear(); + CardSuit[] suits = { CardSuit.Club, CardSuit.Diamond, CardSuit.Heart, CardSuit.Spade }; + CardLabel[] labels = { CardLabel.Ace, CardLabel.Two, + CardLabel.Three, CardLabel.Four, + CardLabel.Five, CardLabel.Six, + CardLabel.Seven, CardLabel.Eight, + CardLabel.Nine, CardLabel.Ten, + CardLabel.Jack, CardLabel.King, + CardLabel.King }; + + foreach (CardSuit s in suits) { + foreach (CardLabel l in labels) { + CardData crd = new CardData(l, s, CardFace.Down); + Deck.Add(crd); + } + } + } + + public void shuffleDeck() { + //shuffle 3 times. + for (int j = 0; j < 3; j++) { + for (int i = 0; i < Deck.Count; i++) { + int rpos = rd.Next(Deck.Count - 1); + CardData tmp = Deck[rpos]; + Deck[rpos] = Deck[i]; + Deck[i] = tmp; + } + } + } + + public int getDeckCount() { + return Deck.Count; + } + + public CardData getTop(CardFace pos) { + CardData crd = null; + if (Deck.Count > 0) { + Deck[0].CardFacePosition = pos; + crd = Deck[0]; + Deck.RemoveAt(0); + } + return crd; + } + + } + +} diff --git a/Blackjack/Blackjack/CardTextures.cs b/Blackjack/Blackjack/CardTextures.cs new file mode 100644 index 0000000..c700dc7 --- /dev/null +++ b/Blackjack/Blackjack/CardTextures.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.GamerServices; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Media; + +namespace Blackjack { + + class CardTextures { + + public static Texture2D Hearts_Ace; + public static Texture2D Hearts_Two; + public static Texture2D Hearts_Three; + public static Texture2D Hearts_Four; + public static Texture2D Hearts_Five; + public static Texture2D Hearts_Six; + public static Texture2D Hearts_Seven; + public static Texture2D Hearts_Eight; + public static Texture2D Hearts_Nine; + public static Texture2D Hearts_Ten; + public static Texture2D Hearts_Jack; + public static Texture2D Hearts_Queen; + public static Texture2D Hearts_King; + + public static Texture2D Diamond_Ace; + public static Texture2D Diamond_Two; + public static Texture2D Diamond_Three; + public static Texture2D Diamond_Four; + public static Texture2D Diamond_Five; + public static Texture2D Diamond_Six; + public static Texture2D Diamond_Seven; + public static Texture2D Diamond_Eight; + public static Texture2D Diamond_Nine; + public static Texture2D Diamond_Ten; + public static Texture2D Diamond_Jack; + public static Texture2D Diamond_Queen; + public static Texture2D Diamond_King; + + public static Texture2D Spade_Ace; + public static Texture2D Spade_Two; + public static Texture2D Spade_Three; + public static Texture2D Spade_Four; + public static Texture2D Spade_Five; + public static Texture2D Spade_Six; + public static Texture2D Spade_Seven; + public static Texture2D Spade_Eight; + public static Texture2D Spade_Nine; + public static Texture2D Spade_Ten; + public static Texture2D Spade_Jack; + public static Texture2D Spade_Queen; + public static Texture2D Spade_King; + + public static Texture2D Club_Ace; + public static Texture2D Club_Two; + public static Texture2D Club_Three; + public static Texture2D Club_Four; + public static Texture2D Club_Five; + public static Texture2D Club_Six; + public static Texture2D Club_Seven; + public static Texture2D Club_Eight; + public static Texture2D Club_Nine; + public static Texture2D Club_Ten; + public static Texture2D Club_Jack; + public static Texture2D Club_Queen; + public static Texture2D Club_King; + + public static Texture2D Card_Back; + + public static void loadCardTextures(Game game) { + + Card_Back = game.Content.Load("Card_Back"); + + Hearts_Ace = game.Content.Load("Hearts_Ace"); + Hearts_Two = game.Content.Load("Hearts_Two"); + Hearts_Three = game.Content.Load("Hearts_Three"); + Hearts_Four = game.Content.Load("Hearts_Four"); + Hearts_Five = game.Content.Load("Hearts_Five"); + Hearts_Six = game.Content.Load("Hearts_Six"); + Hearts_Seven = game.Content.Load("Hearts_Seven"); + Hearts_Eight = game.Content.Load("Hearts_Eight"); + Hearts_Nine = game.Content.Load("Hearts_Nine"); + Hearts_Ten = game.Content.Load("Hearts_Ten"); + Hearts_Jack = game.Content.Load("Hearts_Jack"); + Hearts_Queen = game.Content.Load("Hearts_Queen"); + Hearts_King = game.Content.Load("Hearts_King"); + + Diamond_Ace = game.Content.Load("Diamond_Ace"); + Diamond_Two = game.Content.Load("Diamond_Two"); + Diamond_Three = game.Content.Load("Diamond_Three"); + Diamond_Four = game.Content.Load("Diamond_Four"); + Diamond_Five = game.Content.Load("Diamond_Five"); + Diamond_Six = game.Content.Load("Diamond_Six"); + Diamond_Seven = game.Content.Load("Diamond_Seven"); + Diamond_Eight = game.Content.Load("Diamond_Eight"); + Diamond_Nine = game.Content.Load("Diamond_Nine"); + Diamond_Ten = game.Content.Load("Diamond_Ten"); + Diamond_Jack = game.Content.Load("Diamond_Jack"); + Diamond_Queen = game.Content.Load("Diamond_Queen"); + Diamond_King = game.Content.Load("Diamond_King"); + + Spade_Ace = game.Content.Load("Spade_Ace"); + Spade_Two = game.Content.Load("Spade_Two"); + Spade_Three = game.Content.Load("Spade_Three"); + Spade_Four = game.Content.Load("Spade_Four"); + Spade_Five = game.Content.Load("Spade_Five"); + Spade_Six = game.Content.Load("Spade_Six"); + Spade_Seven = game.Content.Load("Spade_Seven"); + Spade_Eight = game.Content.Load("Spade_Eight"); + Spade_Nine = game.Content.Load("Spade_Nine"); + Spade_Ten = game.Content.Load("Spade_Ten"); + Spade_Jack = game.Content.Load("Spade_Jack"); + Spade_Queen = game.Content.Load("Spade_Queen"); + Spade_King = game.Content.Load("Spade_King"); + + Club_Ace = game.Content.Load("Club_Ace"); + Club_Two = game.Content.Load("Club_Two"); + Club_Three = game.Content.Load("Club_Three"); + Club_Four = game.Content.Load("Club_Four"); + Club_Five = game.Content.Load("Club_Five"); + Club_Six = game.Content.Load("Club_Six"); + Club_Seven = game.Content.Load("Club_Seven"); + Club_Eight = game.Content.Load("Club_Eight"); + Club_Nine = game.Content.Load("Club_Nine"); + Club_Ten = game.Content.Load("Club_Ten"); + Club_Jack = game.Content.Load("Club_Jack"); + Club_Queen = game.Content.Load("Club_Queen"); + Club_King = game.Content.Load("Club_King"); + } + + } + +} diff --git a/Blackjack/Blackjack/Game.ico b/Blackjack/Blackjack/Game.ico new file mode 100644 index 0000000..8cff41e Binary files /dev/null and b/Blackjack/Blackjack/Game.ico differ diff --git a/Blackjack/Blackjack/GameBanker.cs b/Blackjack/Blackjack/GameBanker.cs new file mode 100644 index 0000000..336dd8b --- /dev/null +++ b/Blackjack/Blackjack/GameBanker.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.GamerServices; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Media; + +namespace Blackjack { + + class GameBanker { + + List CardHand = new List(); + + MainGame game; + + public GameBanker(MainGame game){ + this.game = game; + } + + public void Draw(SpriteBatch spriteBatch, Vector2 pos_offset) { + int cardLeft = 0; + foreach (CardData crd in CardHand) { + spriteBatch.Draw(crd.getCardTexture(), new Vector2(pos_offset.X + cardLeft, pos_offset.Y), Color.White); + cardLeft += 45; + } + } + + private PlayerStatusEnum _stat = PlayerStatusEnum.Normal; + + public PlayerStatusEnum PlayerStatus { + get { return _stat; } + set { _stat = value; } + } + + public int GetCardTotal() { + bool containsAce = false; + int aceCount = 0; + int total = 0; + foreach (CardData crd in CardHand) { + if (crd.CardLabel == CardLabel.Ace) { + aceCount++; + containsAce = true; + } + } + if (containsAce) { + //provide highest possible value. + int sumnoace = 0; + foreach (CardData crd in CardHand) { + if (crd.CardLabel != CardLabel.Ace && crd.CardFacePosition == CardFace.Up) sumnoace += crd.getCardValue(); + } + foreach (CardData crd in CardHand) { + if (crd.CardLabel == CardLabel.Ace && crd.CardFacePosition == CardFace.Up) { + if (sumnoace + 11 <= 21) sumnoace += crd.getCardValue(); + else sumnoace++; + } + } + //for (int i = 0; i < aceCount; i++) { + // if (sumnoace + 11 <= 21) sumnoace += 11; + // else sumnoace++; + //} + return sumnoace; + } else { + foreach (CardData crd in CardHand) { + if(crd.CardFacePosition == CardFace.Up) total += crd.getCardValue(); + } + return total; + } + } + + public bool allCardsFlippedUp = false; + + public void flipAllCardsUp() { + foreach (CardData crd in CardHand) { + crd.CardFacePosition = CardFace.Up; + } + allCardsFlippedUp = true; + } + + public void AddCard(CardData card) { + CardHand.Add(card); + } + + public void clearHand() { + CardHand.Clear(); + PlayerStatus = PlayerStatusEnum.Normal; + allCardsFlippedUp = false; + } + + public int getHandCount() { + return CardHand.Count; + } + + } + +} diff --git a/Blackjack/Blackjack/GameButton.cs b/Blackjack/Blackjack/GameButton.cs new file mode 100644 index 0000000..9c9035e --- /dev/null +++ b/Blackjack/Blackjack/GameButton.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.GamerServices; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Media; + + +namespace Blackjack { + + public enum GameButtonStates { + Normal, + Pressed, + Hover, + Disabled + } + + public class GameButton{ + + MainGame game; + + //image state textures + Texture2D img_normal; + Texture2D img_hover; + Texture2D img_pressed; + Texture2D img_disabled; + + Texture2D empty; + + //Button properties + int Width = 0; + int Height = 0; + int Left = 0; + int Top = 0; + + Rectangle buttonrect; + MouseState mlstate; + + GameButtonStates prevstate = GameButtonStates.Normal; + + public delegate void ButtonClickedEvent(); + public event ButtonClickedEvent OnClick; + + int otop = -1; + + public GameButton(MainGame game, int X, int Y, int Width, int Height) { + this.game = game; + this.Width = Width; + this.Height = Height; + Left = X; + Top = Y; + + empty = new Texture2D(game.GraphicsDevice, 1, 1); + empty.SetData(new Color[] { Color.White }); + } + + public void Update(GameTime gameTime) { + if (_visible) { + buttonrect = new Rectangle(Left, Top, Width, Height); + MouseState mstate = Mouse.GetState(); + if (buttonrect.Contains(new Point(mstate.X, mstate.Y))) { + if (mstate.LeftButton == ButtonState.Released) { + MyState = GameButtonStates.Hover; + if (prevstate == GameButtonStates.Pressed) { + Top = otop; + } + } else if (mstate.LeftButton == ButtonState.Pressed) { + if (MyState != GameButtonStates.Pressed) { + otop = otop == -1 ? Top : otop; + Top = otop + 1; + if (OnClick != null) OnClick(); + } + prevstate = MyState; + MyState = GameButtonStates.Pressed; + } else if (mstate.LeftButton == ButtonState.Released && mlstate.LeftButton == ButtonState.Pressed) { + MyState = GameButtonStates.Normal; + Top = otop; + } + } else { + MyState = GameButtonStates.Normal; + } + mlstate = mstate; + } + } + + public void Draw(SpriteBatch spriteBatch) { + if (_visible) { + switch (MyState) { + case GameButtonStates.Normal: + case GameButtonStates.Pressed: + if (img_normal != null) spriteBatch.Draw(img_normal, buttonrect, Color.White); + break; + case GameButtonStates.Hover: + if (img_hover != null) spriteBatch.Draw(img_hover, buttonrect, Color.White); + break; + case GameButtonStates.Disabled: + if (img_disabled != null) spriteBatch.Draw(img_disabled, buttonrect, Color.White); + break; + } + } + } + + private bool _visible = true; + + public void setVisible(bool visible){ + _visible = visible; + } + + public void setNormalImage(String contentname) { + img_normal = game.Content.Load(contentname); + } + + public void setHoverImage(String contentname) { + img_hover = game.Content.Load(contentname); + } + + public void setPressedImage(String contentname) { + img_pressed = game.Content.Load(contentname); + } + + public void setDisabledImage(String contentname) { + img_disabled = game.Content.Load(contentname); + } + + private GameButtonStates _mystate = GameButtonStates.Normal; + public GameButtonStates MyState { + get { return _mystate; } + set { _mystate = value; } + } + + } +} diff --git a/Blackjack/Blackjack/GamePlayer.cs b/Blackjack/Blackjack/GamePlayer.cs new file mode 100644 index 0000000..6cb5c8d --- /dev/null +++ b/Blackjack/Blackjack/GamePlayer.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.GamerServices; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Media; + +namespace Blackjack { + + public enum PlayerStatusEnum { + Normal, + Stay, + Busted, + BlackJack + } + + class GamePlayer { + + List CardHand = new List(); + + MainGame game; + + public GamePlayer(MainGame game){ + this.game = game; + } + + public void Draw(SpriteBatch spriteBatch, Vector2 pos_offset) { + int cardLeft = 0; + int cardTop = 0; + foreach (CardData crd in CardHand) { + spriteBatch.Draw(crd.getCardTexture(), new Vector2(pos_offset.X + cardLeft, pos_offset.Y + cardTop), Color.White); + cardLeft += 30; + cardTop += 10; + } + } + + public int getHandCount() { + return CardHand.Count; + } + + private PlayerStatusEnum _stat = PlayerStatusEnum.Normal; + + public PlayerStatusEnum PlayerStatus { + get { return _stat; } + set { _stat = value; } + } + + + public int GetCardTotal() { + bool containsAce = false; + int aceCount = 0; + int total = 0; + foreach (CardData crd in CardHand) { + if (crd.CardLabel == CardLabel.Ace) { + aceCount++; + containsAce = true; + } + } + if (containsAce) { + //provide highest possible value. + int sumnoace = 0; + foreach (CardData crd in CardHand) { + if(crd.CardLabel != CardLabel.Ace) sumnoace += crd.getCardValue(); + } + for (int i = 0; i < aceCount; i++) { + if (sumnoace + 11 <= 21) sumnoace += 11; + else sumnoace++; + } + return sumnoace; + } else { + foreach (CardData crd in CardHand) { + total += crd.getCardValue(); + } + return total; + } + } + + public void AddCard(CardData card) { + CardHand.Add(card); + } + + public void clearHand() { + CardHand.Clear(); + PlayerStatus = PlayerStatusEnum.Normal; + } + + } + +} diff --git a/Blackjack/Blackjack/GameThumbnail.png b/Blackjack/Blackjack/GameThumbnail.png new file mode 100644 index 0000000..462311a Binary files /dev/null and b/Blackjack/Blackjack/GameThumbnail.png differ diff --git a/Blackjack/Blackjack/MainGame.cs b/Blackjack/Blackjack/MainGame.cs new file mode 100644 index 0000000..ed2b109 --- /dev/null +++ b/Blackjack/Blackjack/MainGame.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.GamerServices; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Media; + +namespace Blackjack { + + public enum GameState { + Nothing, + StartScreen, + GameScreen + } + + public class MainGame : Microsoft.Xna.Framework.Game { + GraphicsDeviceManager graphics; + SpriteBatch spriteBatch; + + GameState currentScreen = GameState.Nothing; + + PlayScreen playScreen; + StartScreen startScreen; + + public MainGame() { + graphics = new GraphicsDeviceManager(this); //800 x 480 + Window.Title = "Black Jack - Project in AI by John Espiritu"; + Content.RootDirectory = "Content"; + IsMouseVisible = true; + } + + protected override void LoadContent() { + spriteBatch = new SpriteBatch(GraphicsDevice); + + //Preload card textures + CardTextures.loadCardTextures(this); + + //Load start screen. + startScreen = new StartScreen(this); + currentScreen = GameState.StartScreen; + + base.LoadContent(); + } + + protected override void UnloadContent() { + + } + + protected override void Update(GameTime gameTime) { + if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) + this.Exit(); + + switch (currentScreen) { + case GameState.StartScreen: + startScreen.Update(gameTime); + break; + case GameState.GameScreen: + playScreen.Update(gameTime); + break; + } + + base.Update(gameTime); + } + + protected override void Draw(GameTime gameTime) { + GraphicsDevice.Clear(new Color(27,29,32)); + + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied); + + //Draw active screen. + switch (currentScreen) { + case GameState.StartScreen: + startScreen.Draw(spriteBatch); + break; + case GameState.GameScreen: + playScreen.Draw(spriteBatch); + break; + } + + spriteBatch.End(); + + base.Draw(gameTime); + } + + public void StartGame() { + playScreen = new PlayScreen(this); + currentScreen = GameState.GameScreen; + } + + } +} diff --git a/Blackjack/Blackjack/PlayScreen.cs b/Blackjack/Blackjack/PlayScreen.cs new file mode 100644 index 0000000..9396153 --- /dev/null +++ b/Blackjack/Blackjack/PlayScreen.cs @@ -0,0 +1,346 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.GamerServices; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Media; + + +namespace Blackjack { + + public enum GameTurn { + Deal, + Player, + Banker, + EndRound, + StandbyEndRound + } + + public class PlayScreen { + + //Gamer data + GamePlayer player; + GameBanker banker; + + CardDeck deck = new CardDeck(); + + Texture2D blackOverlay; + Rectangle blackOverlay_rect; + + Texture2D bgimg; + Texture2D carddeck; + Texture2D scoreboard_bg; + SpriteFont scoreboard_fnt; + + //Status textures + Texture2D status_busted; + Texture2D status_stay; + Texture2D status_bj; + + MainGame game; + + int overlay_alpha = 255; + + double overlay_delay = 0.05f; + + SoundEffectInstance bgm; + + //Buttons + GameButton btnHit; + GameButton btnStay; + GameButton btnDeal; + + GameTurn GameStatus = GameTurn.Deal; + + //Scores + int playerwin = 0; + int bankerwin = 0; + + public PlayScreen(MainGame game) { + this.game = game; + + //Set background. + bgimg = game.Content.Load("GameBG"); + + //Set carddeck image. + carddeck = game.Content.Load("card_deck"); + + //Set overlay. + blackOverlay = new Texture2D(game.GraphicsDevice, 1, 1); + blackOverlay_rect = new Rectangle(0, 0, game.GraphicsDevice.Viewport.Width, game.GraphicsDevice.Viewport.Height); + blackOverlay.SetData(new Color[] { Color.Black }); + + //Set status image + status_bj = game.Content.Load("status_blackjack"); + status_busted = game.Content.Load("status_busted"); + status_stay = game.Content.Load("status_stay"); + + //Play background music. + bgm = game.Content.Load("game_bgm").CreateInstance(); + bgm.Volume = 0.5f; + bgm.IsLooped = true; + bgm.Play(); + + //Setup scoreboard info. + scoreboard_bg = game.Content.Load("scoreboard_bg"); + scoreboard_fnt = game.Content.Load("ScoreboardFont"); + + //Setup buttons + btnHit = new GameButton(game, game.GraphicsDevice.Viewport.Width - 150, game.GraphicsDevice.Viewport.Height - 250, 130, 75); + btnHit.setNormalImage("button_hit_normal"); + btnHit.setHoverImage("button_hit_hover"); + btnHit.OnClick += new GameButton.ButtonClickedEvent(btnHit_OnClick); + + btnStay = new GameButton(game, game.GraphicsDevice.Viewport.Width - 150, game.GraphicsDevice.Viewport.Height - 170, 130, 75); + btnStay.setNormalImage("button_stay_normal"); + btnStay.setHoverImage("button_stay_hover"); + btnStay.OnClick += new GameButton.ButtonClickedEvent(btnStay_OnClick); + + btnDeal = new GameButton(game, game.GraphicsDevice.Viewport.Width - 150, game.GraphicsDevice.Viewport.Height - 90, 130, 75); + btnDeal.setNormalImage("button_deal_normal"); + btnDeal.setHoverImage("button_deal_hover"); + btnDeal.OnClick += new GameButton.ButtonClickedEvent(btnDeal_OnClick); + + //Setup player object. + player = new GamePlayer(game); + banker = new GameBanker(game); + + //Deal. + GameStatus = GameTurn.Deal; + } + + private void endRound() { + if ((player.PlayerStatus == PlayerStatusEnum.BlackJack && banker.PlayerStatus == PlayerStatusEnum.Stay) || (player.PlayerStatus == PlayerStatusEnum.BlackJack && banker.PlayerStatus == PlayerStatusEnum.Busted)) + playerwin++; + else if ((player.PlayerStatus == PlayerStatusEnum.Stay && banker.PlayerStatus == PlayerStatusEnum.BlackJack) || (player.PlayerStatus == PlayerStatusEnum.Busted && banker.PlayerStatus == PlayerStatusEnum.BlackJack)) + bankerwin++; + else if (player.PlayerStatus == PlayerStatusEnum.Busted && banker.PlayerStatus == PlayerStatusEnum.Stay) + bankerwin++; + else if (player.PlayerStatus == PlayerStatusEnum.Stay && banker.PlayerStatus == PlayerStatusEnum.Busted) + playerwin++; + else if (player.PlayerStatus == PlayerStatusEnum.Stay && banker.PlayerStatus == PlayerStatusEnum.Stay) { + if (player.GetCardTotal() > banker.GetCardTotal()) + playerwin++; + else if (player.GetCardTotal() < banker.GetCardTotal()) + bankerwin++; + } + GameStatus = GameTurn.StandbyEndRound; + } + + Random rnddes = new Random(); + private void runAI() { + //Show 'em the cards baby. + if(banker.allCardsFlippedUp == false) banker.flipAllCardsUp(); + + //Analyze score. + int aiscore = banker.GetCardTotal(); + + if (aiscore == 21 && banker.getHandCount() == 2) { + banker.PlayerStatus = PlayerStatusEnum.BlackJack; + GameStatus = GameTurn.EndRound; + return; + } + + if (player.PlayerStatus == PlayerStatusEnum.Busted) { + banker.PlayerStatus = PlayerStatusEnum.Stay; + GameStatus = GameTurn.EndRound; + return; + } + + if (aiscore > 21) { + banker.PlayerStatus = PlayerStatusEnum.Busted; + GameStatus = GameTurn.EndRound; + return; + } else { + if (aiscore == 21) { + banker.PlayerStatus = PlayerStatusEnum.Stay; + GameStatus = GameTurn.EndRound; + return; + } + } + + //tally if AI should hit, or stay. + byte hitrate = 0; // of 10 + //Rate probability of hitting. + if (aiscore <= 13) + hitrate = 10; + else if (aiscore > 13 && aiscore <= 16) + hitrate = 8; + else if (aiscore > 16 && aiscore <= 18) + hitrate = 5; + else if (aiscore > 18 && aiscore <= 20) + hitrate = 2; + + //fill up probability array. + bool[] decisionarray = new bool[10]; + for (int i = 0; i < 10; i++) { + if (i <= hitrate - 1) + decisionarray[i] = true; + else + decisionarray[i] = false; + } + + //Decide by probability + int decideindex = rnddes.Next(0, 9); + bool willHit = decisionarray[decideindex]; + if (willHit) { + banker.AddCard(deck.getTop(CardFace.Up)); + } else { + banker.PlayerStatus = PlayerStatusEnum.Stay; + GameStatus = GameTurn.EndRound; + return; + } + } + + private void btnDeal_OnClick() { + GameStatus = GameTurn.Deal; + } + + private void btnStay_OnClick() { + if (GameStatus == GameTurn.Player) { + GameStatus = GameTurn.Banker; + player.PlayerStatus = PlayerStatusEnum.Stay; + } + } + + private void btnHit_OnClick() { + hitCard(); + } + + private void checkPlayerCards() { + if (player.GetCardTotal() == 21) { + if (player.getHandCount() == 2) { + player.PlayerStatus = PlayerStatusEnum.BlackJack; + } else { + player.PlayerStatus = PlayerStatusEnum.Stay; + } + } + + if (player.GetCardTotal() > 21) + player.PlayerStatus = PlayerStatusEnum.Busted; + + if (player.GetCardTotal() >= 21) { + GameStatus = GameTurn.Banker; + } else { + GameStatus = GameTurn.Player; + } + } + + public void dealCards() { + if (deck.getDeckCount() < 10) { + deck.restoreDeck(); + deck.shuffleDeck(); + } + player.clearHand(); + banker.clearHand(); + player.AddCard(deck.getTop(CardFace.Up)); + banker.AddCard(deck.getTop(CardFace.Down)); + player.AddCard(deck.getTop(CardFace.Up)); + banker.AddCard(deck.getTop(CardFace.Up)); + } + + public void hitCard() { + if (GameStatus == GameTurn.Player) { + player.AddCard(deck.getTop(CardFace.Up)); + checkPlayerCards(); + } + } + + public void Update(GameTime gameTime) { + //Fade in. + if (overlay_alpha > 0) { + overlay_delay -= gameTime.ElapsedGameTime.TotalSeconds; + if (overlay_delay <= 0) { + overlay_delay = 0.05f; + overlay_alpha -= 25; + } + } + + btnHit.Update(gameTime); + btnStay.Update(gameTime); + btnDeal.Update(gameTime); + //Start game. + + if (GameStatus != GameTurn.StandbyEndRound) + btnDeal.setVisible(false); + else + btnDeal.setVisible(true); + + //Deal. + if (GameStatus == GameTurn.Deal) { + dealCards(); + GameStatus = GameTurn.Player; + } + + //Check if player is black jack. + if (GameStatus == GameTurn.Player) { + checkPlayerCards(); + } + + if (GameStatus == GameTurn.Banker) { + runAI(); + } + + if (GameStatus == GameTurn.EndRound) { + endRound(); + } + } + + public void Draw(SpriteBatch spriteBatch) { + //Draw bg + spriteBatch.Draw(bgimg, new Vector2(0, 0), Color.White); + + //Draw scoreboard bg. + spriteBatch.Draw(scoreboard_bg, new Vector2(game.GraphicsDevice.Viewport.Width - 450, game.GraphicsDevice.Viewport.Height - 250), Color.White); + + //Draw scorez + spriteBatch.DrawString(scoreboard_fnt, "Your hand: " + player.GetCardTotal(), new Vector2(380, 250), Color.White); + spriteBatch.DrawString(scoreboard_fnt, "Banker's hand: " + banker.GetCardTotal(), new Vector2(380, 280), Color.White); + + spriteBatch.DrawString(scoreboard_fnt, "Player Win: " + playerwin, new Vector2(380, 310), Color.White); + spriteBatch.DrawString(scoreboard_fnt, "Banker Win: " + bankerwin, new Vector2(380, 340), Color.White); + + //Draw deck sprite. + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); + spriteBatch.Draw(carddeck, new Vector2(40, 15), Color.White); + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied); + + //Draw player hand. + player.Draw(spriteBatch, new Vector2(35, game.GraphicsDevice.Viewport.Height - 220)); + + //Draw banker hand. + banker.Draw(spriteBatch, new Vector2((game.GraphicsDevice.Viewport.Width / 2) - 100, 60)); + + //Draw butotns. + btnHit.Draw(spriteBatch); + btnStay.Draw(spriteBatch); + btnDeal.Draw(spriteBatch); + + //Draw player status + if(player.PlayerStatus == PlayerStatusEnum.Stay) + spriteBatch.Draw(status_stay, new Vector2(30, game.GraphicsDevice.Viewport.Height - 80), Color.White); + else if(player.PlayerStatus == PlayerStatusEnum.BlackJack) + spriteBatch.Draw(status_bj, new Vector2(30, game.GraphicsDevice.Viewport.Height - 80), Color.White); + else if(player.PlayerStatus == PlayerStatusEnum.Busted) + spriteBatch.Draw(status_busted, new Vector2(30, game.GraphicsDevice.Viewport.Height - 80), Color.White); + + //Draw banker status. + if (banker.PlayerStatus == PlayerStatusEnum.Stay) + spriteBatch.Draw(status_stay, new Vector2((game.GraphicsDevice.Viewport.Width - status_stay.Width) / 2, 120), Color.White); + else if (banker.PlayerStatus == PlayerStatusEnum.BlackJack) + spriteBatch.Draw(status_bj, new Vector2((game.GraphicsDevice.Viewport.Width - status_stay.Width) / 2, 120), Color.White); + else if (banker.PlayerStatus == PlayerStatusEnum.Busted) + spriteBatch.Draw(status_busted, new Vector2((game.GraphicsDevice.Viewport.Width - status_stay.Width) / 2, 120), Color.White); + + //Draw overlay. + spriteBatch.Draw(blackOverlay, blackOverlay_rect, new Color(255, 255, 255, overlay_alpha)); + } + + } +} diff --git a/Blackjack/Blackjack/Program.cs b/Blackjack/Blackjack/Program.cs new file mode 100644 index 0000000..bdc9b43 --- /dev/null +++ b/Blackjack/Blackjack/Program.cs @@ -0,0 +1,20 @@ +using System; + +namespace Blackjack { +#if WINDOWS || XBOX + static class Program + { + /// + /// The main entry point for the application. + /// + static void Main(string[] args) + { + using (MainGame game = new MainGame()) + { + game.Run(); + } + } + } +#endif +} + diff --git a/Blackjack/Blackjack/Properties/AssemblyInfo.cs b/Blackjack/Blackjack/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..cf12c21 --- /dev/null +++ b/Blackjack/Blackjack/Properties/AssemblyInfo.cs @@ -0,0 +1,34 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Blackjack")] +[assembly: AssemblyProduct("Blackjack")] +[assembly: AssemblyDescription("Project by John Espiritu")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. Only Windows +// assemblies support COM. +[assembly: ComVisible(false)] + +// On Windows, the following GUID is for the ID of the typelib if this +// project is exposed to COM. On other platforms, it unique identifies the +// title storage container when deploying this assembly to the device. +[assembly: Guid("59921487-919d-425b-8808-3983c2b29121")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] diff --git a/Blackjack/Blackjack/StartScreen.cs b/Blackjack/Blackjack/StartScreen.cs new file mode 100644 index 0000000..6d6857f --- /dev/null +++ b/Blackjack/Blackjack/StartScreen.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.GamerServices; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Media; + + +namespace Blackjack { + /// + /// This is a game component that implements IUpdateable. + /// + public class StartScreen{ + + MainGame game; + KeyboardState lastKeystate; + + Texture2D titlesprite; + Texture2D bgsplash; + Texture2D pressstart; + Texture2D blackoverlay; + Rectangle overlayRect; + Vector2 titlesprite_pos = new Vector2(0, 0); + Vector2 pressstart_pos = new Vector2(0, 0); + SoundEffect bgmusic; + SoundEffectInstance sfxin; + + double closing_delay = 0.005f; + double pressstart_fadedelay = 0.001f; + bool pressstart_isfading = true; + + int pressstart_alpha = 255; + int overlay_alpha = 0; + bool screenclosing = false; + + public StartScreen(MainGame game) { + this.game = game; + titlesprite = game.Content.Load("blackjack_logo"); + bgsplash = game.Content.Load("bg_splash"); + pressstart = game.Content.Load("press_enter_to_start"); + bgmusic = game.Content.Load("cybersoldier"); + sfxin = bgmusic.CreateInstance(); + sfxin.IsLooped = true; + sfxin.Volume = 0.3f; + sfxin.Play(); + titlesprite_pos = new Vector2((game.GraphicsDevice.Viewport.Width - titlesprite.Width) / 2, 100); + pressstart_pos = new Vector2((game.GraphicsDevice.Viewport.Width - pressstart.Width) / 2, 280); + + blackoverlay = new Texture2D(game.GraphicsDevice, 1, 1); + overlayRect = new Rectangle(0, 0, game.GraphicsDevice.Viewport.Width, game.GraphicsDevice.Viewport.Height); + blackoverlay.SetData(new Color[] { Color.Black}); + } + + public void Unload() { + sfxin.Stop(); + sfxin.Dispose(); + titlesprite.Dispose(); + bgsplash.Dispose(); + pressstart.Dispose(); + blackoverlay.Dispose(); + } + + private void CloseScreen() { + screenclosing = true; + } + + public void Update(GameTime gameTime) { + KeyboardState keystate = Keyboard.GetState(); + if (keystate.IsKeyDown(Keys.Enter) && lastKeystate.IsKeyUp(Keys.Enter)) { + //Start game. + CloseScreen(); + } + lastKeystate = keystate; + + if (pressstart_alpha <= 0) pressstart_isfading = false; + else if (pressstart_alpha >= 255) pressstart_isfading = true; + + //Press start fade in/out animation. + pressstart_fadedelay -= gameTime.ElapsedGameTime.TotalSeconds; + if (pressstart_fadedelay <= 0) { + pressstart_fadedelay = 0.001f; + if (pressstart_isfading) { + pressstart_alpha -= 5; + } else { + pressstart_alpha += 5; + } + } + + if (screenclosing) { + closing_delay -= gameTime.ElapsedGameTime.TotalSeconds; + if (closing_delay <= 0) { + closing_delay = 0.05f; + overlay_alpha += 25; + } + if (overlay_alpha > 255) { + Unload(); + game.StartGame(); + } + } + + } + + //override draw component. + public void Draw(SpriteBatch spriteBatch) { + + spriteBatch.Draw(bgsplash, new Vector2(0, 0), Color.White); + spriteBatch.Draw(titlesprite, titlesprite_pos, new Color(255, 255, 255, 255)); + spriteBatch.Draw(pressstart, pressstart_pos, new Color(255, 255, 255, pressstart_alpha)); + spriteBatch.Draw(blackoverlay, overlayRect, new Color(255, 255, 255, overlay_alpha)); + + } + + public void StartGame() { + + } + + } +} diff --git a/Blackjack/Blackjack/Thumbs.db b/Blackjack/Blackjack/Thumbs.db new file mode 100644 index 0000000..d7cd3c4 Binary files /dev/null and b/Blackjack/Blackjack/Thumbs.db differ diff --git a/Blackjack/BlackjackContent/BlackjackContent.contentproj b/Blackjack/BlackjackContent/BlackjackContent.contentproj new file mode 100644 index 0000000..9e6e752 --- /dev/null +++ b/Blackjack/BlackjackContent/BlackjackContent.contentproj @@ -0,0 +1,431 @@ + + + + {53A91419-7407-4ADC-B67C-715C2B6B120C} + {96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Debug + x86 + Library + Properties + v4.0 + v4.0 + bin\$(Platform)\$(Configuration) + Content + + + x86 + + + x86 + + + AIProjectContent + + + + False + + + False + + + False + + + False + + + False + + + False + + + + + bg_splash + TextureImporter + TextureProcessor + + + blackjack_logo + TextureImporter + TextureProcessor + + + press_enter_to_start + TextureImporter + TextureProcessor + + + + + cybersoldier + WavImporter + SoundEffectProcessor + + + + + GameBG + TextureImporter + TextureProcessor + + + + + card_deck + TextureImporter + TextureProcessor + + + + + button_hit_hover + TextureImporter + TextureProcessor + + + button_hit_normal + TextureImporter + TextureProcessor + + + + + Card_Back + TextureImporter + TextureProcessor + + + Club_Ace + TextureImporter + TextureProcessor + + + Club_Eight + TextureImporter + TextureProcessor + + + Club_Five + TextureImporter + TextureProcessor + + + Club_Four + TextureImporter + TextureProcessor + + + Club_Jack + TextureImporter + TextureProcessor + + + Club_King + TextureImporter + TextureProcessor + + + Club_Nine + TextureImporter + TextureProcessor + + + Club_Queen + TextureImporter + TextureProcessor + + + Club_Seven + TextureImporter + TextureProcessor + + + Club_Six + TextureImporter + TextureProcessor + + + Club_Ten + TextureImporter + TextureProcessor + + + Club_Three + TextureImporter + TextureProcessor + + + Club_Two + TextureImporter + TextureProcessor + + + Diamond_Ace + TextureImporter + TextureProcessor + + + Diamond_Eight + TextureImporter + TextureProcessor + + + Diamond_Five + TextureImporter + TextureProcessor + + + Diamond_Four + TextureImporter + TextureProcessor + + + Diamond_Jack + TextureImporter + TextureProcessor + + + Diamond_King + TextureImporter + TextureProcessor + + + Diamond_Nine + TextureImporter + TextureProcessor + + + Diamond_Queen + TextureImporter + TextureProcessor + + + Diamond_Seven + TextureImporter + TextureProcessor + + + Diamond_Six + TextureImporter + TextureProcessor + + + Diamond_Ten + TextureImporter + TextureProcessor + + + Diamond_Three + TextureImporter + TextureProcessor + + + Diamond_Two + TextureImporter + TextureProcessor + + + Hearts_Ace + TextureImporter + TextureProcessor + + + Hearts_Eight + TextureImporter + TextureProcessor + + + Hearts_Five + TextureImporter + TextureProcessor + + + Hearts_Four + TextureImporter + TextureProcessor + + + Hearts_Jack + TextureImporter + TextureProcessor + + + Hearts_King + TextureImporter + TextureProcessor + + + Hearts_Nine + TextureImporter + TextureProcessor + + + Hearts_Queen + TextureImporter + TextureProcessor + + + Hearts_Seven + TextureImporter + TextureProcessor + + + Hearts_Six + TextureImporter + TextureProcessor + + + Hearts_Three + TextureImporter + TextureProcessor + + + Hearts_Two + TextureImporter + TextureProcessor + + + Hearts_Ten + TextureImporter + TextureProcessor + + + Spade_Ace + TextureImporter + TextureProcessor + + + Spade_Eight + TextureImporter + TextureProcessor + + + Spade_Five + TextureImporter + TextureProcessor + + + Spade_Four + TextureImporter + TextureProcessor + + + Spade_Jack + TextureImporter + TextureProcessor + + + Spade_King + TextureImporter + TextureProcessor + + + Spade_Nine + TextureImporter + TextureProcessor + + + Spade_Queen + TextureImporter + TextureProcessor + + + Spade_Seven + TextureImporter + TextureProcessor + + + Spade_Six + TextureImporter + TextureProcessor + + + Spade_Ten + TextureImporter + TextureProcessor + + + Spade_Three + TextureImporter + TextureProcessor + + + Spade_Two + TextureImporter + TextureProcessor + + + + + button_stay_hover + TextureImporter + TextureProcessor + + + button_stay_normal + TextureImporter + TextureProcessor + + + + + scoreboard_bg + TextureImporter + TextureProcessor + + + + + ScoreboardFont + FontDescriptionImporter + FontDescriptionProcessor + + + + + status_blackjack + TextureImporter + TextureProcessor + + + status_busted + TextureImporter + TextureProcessor + + + status_stay + TextureImporter + TextureProcessor + + + + + game_bgm + WavImporter + SoundEffectProcessor + + + + + button_deal_hover + TextureImporter + TextureProcessor + + + button_deal_normal + TextureImporter + TextureProcessor + + + + + \ No newline at end of file diff --git a/Blackjack/BlackjackContent/Card_Back.png b/Blackjack/BlackjackContent/Card_Back.png new file mode 100644 index 0000000..2a77ac1 Binary files /dev/null and b/Blackjack/BlackjackContent/Card_Back.png differ diff --git a/Blackjack/BlackjackContent/Club_Ace.png b/Blackjack/BlackjackContent/Club_Ace.png new file mode 100644 index 0000000..babcecc Binary files /dev/null and b/Blackjack/BlackjackContent/Club_Ace.png differ diff --git a/Blackjack/BlackjackContent/Club_Eight.png b/Blackjack/BlackjackContent/Club_Eight.png new file mode 100644 index 0000000..ddff2ee Binary files /dev/null and b/Blackjack/BlackjackContent/Club_Eight.png differ diff --git a/Blackjack/BlackjackContent/Club_Five.png b/Blackjack/BlackjackContent/Club_Five.png new file mode 100644 index 0000000..f8fd50f Binary files /dev/null and b/Blackjack/BlackjackContent/Club_Five.png differ diff --git a/Blackjack/BlackjackContent/Club_Four.png b/Blackjack/BlackjackContent/Club_Four.png new file mode 100644 index 0000000..068d998 Binary files /dev/null and b/Blackjack/BlackjackContent/Club_Four.png differ diff --git a/Blackjack/BlackjackContent/Club_Jack.png b/Blackjack/BlackjackContent/Club_Jack.png new file mode 100644 index 0000000..cb3168c Binary files /dev/null and b/Blackjack/BlackjackContent/Club_Jack.png differ diff --git a/Blackjack/BlackjackContent/Club_King.png b/Blackjack/BlackjackContent/Club_King.png new file mode 100644 index 0000000..77704ad Binary files /dev/null and b/Blackjack/BlackjackContent/Club_King.png differ diff --git a/Blackjack/BlackjackContent/Club_Nine.png b/Blackjack/BlackjackContent/Club_Nine.png new file mode 100644 index 0000000..91b3a00 Binary files /dev/null and b/Blackjack/BlackjackContent/Club_Nine.png differ diff --git a/Blackjack/BlackjackContent/Club_Queen.png b/Blackjack/BlackjackContent/Club_Queen.png new file mode 100644 index 0000000..c2b9163 Binary files /dev/null and b/Blackjack/BlackjackContent/Club_Queen.png differ diff --git a/Blackjack/BlackjackContent/Club_Seven.png b/Blackjack/BlackjackContent/Club_Seven.png new file mode 100644 index 0000000..912c0a6 Binary files /dev/null and b/Blackjack/BlackjackContent/Club_Seven.png differ diff --git a/Blackjack/BlackjackContent/Club_Six.png b/Blackjack/BlackjackContent/Club_Six.png new file mode 100644 index 0000000..473c07e Binary files /dev/null and b/Blackjack/BlackjackContent/Club_Six.png differ diff --git a/Blackjack/BlackjackContent/Club_Ten.png b/Blackjack/BlackjackContent/Club_Ten.png new file mode 100644 index 0000000..1ebfeb6 Binary files /dev/null and b/Blackjack/BlackjackContent/Club_Ten.png differ diff --git a/Blackjack/BlackjackContent/Club_Three.png b/Blackjack/BlackjackContent/Club_Three.png new file mode 100644 index 0000000..d469da0 Binary files /dev/null and b/Blackjack/BlackjackContent/Club_Three.png differ diff --git a/Blackjack/BlackjackContent/Club_Two.png b/Blackjack/BlackjackContent/Club_Two.png new file mode 100644 index 0000000..398b35f Binary files /dev/null and b/Blackjack/BlackjackContent/Club_Two.png differ diff --git a/Blackjack/BlackjackContent/Diamond_Ace.png b/Blackjack/BlackjackContent/Diamond_Ace.png new file mode 100644 index 0000000..1b37195 Binary files /dev/null and b/Blackjack/BlackjackContent/Diamond_Ace.png differ diff --git a/Blackjack/BlackjackContent/Diamond_Eight.png b/Blackjack/BlackjackContent/Diamond_Eight.png new file mode 100644 index 0000000..2dc38d1 Binary files /dev/null and b/Blackjack/BlackjackContent/Diamond_Eight.png differ diff --git a/Blackjack/BlackjackContent/Diamond_Five.png b/Blackjack/BlackjackContent/Diamond_Five.png new file mode 100644 index 0000000..e81d788 Binary files /dev/null and b/Blackjack/BlackjackContent/Diamond_Five.png differ diff --git a/Blackjack/BlackjackContent/Diamond_Four.png b/Blackjack/BlackjackContent/Diamond_Four.png new file mode 100644 index 0000000..f6ad5d2 Binary files /dev/null and b/Blackjack/BlackjackContent/Diamond_Four.png differ diff --git a/Blackjack/BlackjackContent/Diamond_Jack.png b/Blackjack/BlackjackContent/Diamond_Jack.png new file mode 100644 index 0000000..e38201e Binary files /dev/null and b/Blackjack/BlackjackContent/Diamond_Jack.png differ diff --git a/Blackjack/BlackjackContent/Diamond_King.png b/Blackjack/BlackjackContent/Diamond_King.png new file mode 100644 index 0000000..f4972ae Binary files /dev/null and b/Blackjack/BlackjackContent/Diamond_King.png differ diff --git a/Blackjack/BlackjackContent/Diamond_Nine.png b/Blackjack/BlackjackContent/Diamond_Nine.png new file mode 100644 index 0000000..ff93da1 Binary files /dev/null and b/Blackjack/BlackjackContent/Diamond_Nine.png differ diff --git a/Blackjack/BlackjackContent/Diamond_Queen.png b/Blackjack/BlackjackContent/Diamond_Queen.png new file mode 100644 index 0000000..b545914 Binary files /dev/null and b/Blackjack/BlackjackContent/Diamond_Queen.png differ diff --git a/Blackjack/BlackjackContent/Diamond_Seven.png b/Blackjack/BlackjackContent/Diamond_Seven.png new file mode 100644 index 0000000..7bd01b8 Binary files /dev/null and b/Blackjack/BlackjackContent/Diamond_Seven.png differ diff --git a/Blackjack/BlackjackContent/Diamond_Six.png b/Blackjack/BlackjackContent/Diamond_Six.png new file mode 100644 index 0000000..275ceca Binary files /dev/null and b/Blackjack/BlackjackContent/Diamond_Six.png differ diff --git a/Blackjack/BlackjackContent/Diamond_Ten.png b/Blackjack/BlackjackContent/Diamond_Ten.png new file mode 100644 index 0000000..0cc4a97 Binary files /dev/null and b/Blackjack/BlackjackContent/Diamond_Ten.png differ diff --git a/Blackjack/BlackjackContent/Diamond_Three.png b/Blackjack/BlackjackContent/Diamond_Three.png new file mode 100644 index 0000000..41222c7 Binary files /dev/null and b/Blackjack/BlackjackContent/Diamond_Three.png differ diff --git a/Blackjack/BlackjackContent/Diamond_Two.png b/Blackjack/BlackjackContent/Diamond_Two.png new file mode 100644 index 0000000..077e38b Binary files /dev/null and b/Blackjack/BlackjackContent/Diamond_Two.png differ diff --git a/Blackjack/BlackjackContent/GameBG.png b/Blackjack/BlackjackContent/GameBG.png new file mode 100644 index 0000000..7f5d77d Binary files /dev/null and b/Blackjack/BlackjackContent/GameBG.png differ diff --git a/Blackjack/BlackjackContent/Hearts_Ace.png b/Blackjack/BlackjackContent/Hearts_Ace.png new file mode 100644 index 0000000..f42d24b Binary files /dev/null and b/Blackjack/BlackjackContent/Hearts_Ace.png differ diff --git a/Blackjack/BlackjackContent/Hearts_Eight.png b/Blackjack/BlackjackContent/Hearts_Eight.png new file mode 100644 index 0000000..a9ebf83 Binary files /dev/null and b/Blackjack/BlackjackContent/Hearts_Eight.png differ diff --git a/Blackjack/BlackjackContent/Hearts_Five.png b/Blackjack/BlackjackContent/Hearts_Five.png new file mode 100644 index 0000000..4e43c07 Binary files /dev/null and b/Blackjack/BlackjackContent/Hearts_Five.png differ diff --git a/Blackjack/BlackjackContent/Hearts_Four.png b/Blackjack/BlackjackContent/Hearts_Four.png new file mode 100644 index 0000000..54cd453 Binary files /dev/null and b/Blackjack/BlackjackContent/Hearts_Four.png differ diff --git a/Blackjack/BlackjackContent/Hearts_Jack.png b/Blackjack/BlackjackContent/Hearts_Jack.png new file mode 100644 index 0000000..a770783 Binary files /dev/null and b/Blackjack/BlackjackContent/Hearts_Jack.png differ diff --git a/Blackjack/BlackjackContent/Hearts_King.png b/Blackjack/BlackjackContent/Hearts_King.png new file mode 100644 index 0000000..6ead4fd Binary files /dev/null and b/Blackjack/BlackjackContent/Hearts_King.png differ diff --git a/Blackjack/BlackjackContent/Hearts_Nine.png b/Blackjack/BlackjackContent/Hearts_Nine.png new file mode 100644 index 0000000..1a91a70 Binary files /dev/null and b/Blackjack/BlackjackContent/Hearts_Nine.png differ diff --git a/Blackjack/BlackjackContent/Hearts_Queen.png b/Blackjack/BlackjackContent/Hearts_Queen.png new file mode 100644 index 0000000..9f4305f Binary files /dev/null and b/Blackjack/BlackjackContent/Hearts_Queen.png differ diff --git a/Blackjack/BlackjackContent/Hearts_Seven.png b/Blackjack/BlackjackContent/Hearts_Seven.png new file mode 100644 index 0000000..fd88fa0 Binary files /dev/null and b/Blackjack/BlackjackContent/Hearts_Seven.png differ diff --git a/Blackjack/BlackjackContent/Hearts_Six.png b/Blackjack/BlackjackContent/Hearts_Six.png new file mode 100644 index 0000000..c48d95f Binary files /dev/null and b/Blackjack/BlackjackContent/Hearts_Six.png differ diff --git a/Blackjack/BlackjackContent/Hearts_Ten.png b/Blackjack/BlackjackContent/Hearts_Ten.png new file mode 100644 index 0000000..7fc2ddb Binary files /dev/null and b/Blackjack/BlackjackContent/Hearts_Ten.png differ diff --git a/Blackjack/BlackjackContent/Hearts_Three.png b/Blackjack/BlackjackContent/Hearts_Three.png new file mode 100644 index 0000000..6c57cf5 Binary files /dev/null and b/Blackjack/BlackjackContent/Hearts_Three.png differ diff --git a/Blackjack/BlackjackContent/Hearts_Two.png b/Blackjack/BlackjackContent/Hearts_Two.png new file mode 100644 index 0000000..b8c25f0 Binary files /dev/null and b/Blackjack/BlackjackContent/Hearts_Two.png differ diff --git a/Blackjack/BlackjackContent/ScoreboardFont.spritefont b/Blackjack/BlackjackContent/ScoreboardFont.spritefont new file mode 100644 index 0000000..45dd13f --- /dev/null +++ b/Blackjack/BlackjackContent/ScoreboardFont.spritefont @@ -0,0 +1,60 @@ + + + + + + + Segoe UI + + + 12 + + + 0 + + + true + + + + + + + + + + + + ~ + + + + diff --git a/Blackjack/BlackjackContent/Spade_Ace.png b/Blackjack/BlackjackContent/Spade_Ace.png new file mode 100644 index 0000000..6ba0d9b Binary files /dev/null and b/Blackjack/BlackjackContent/Spade_Ace.png differ diff --git a/Blackjack/BlackjackContent/Spade_Eight.png b/Blackjack/BlackjackContent/Spade_Eight.png new file mode 100644 index 0000000..7ea31a2 Binary files /dev/null and b/Blackjack/BlackjackContent/Spade_Eight.png differ diff --git a/Blackjack/BlackjackContent/Spade_Five.png b/Blackjack/BlackjackContent/Spade_Five.png new file mode 100644 index 0000000..fc3d6a5 Binary files /dev/null and b/Blackjack/BlackjackContent/Spade_Five.png differ diff --git a/Blackjack/BlackjackContent/Spade_Four.png b/Blackjack/BlackjackContent/Spade_Four.png new file mode 100644 index 0000000..eee21aa Binary files /dev/null and b/Blackjack/BlackjackContent/Spade_Four.png differ diff --git a/Blackjack/BlackjackContent/Spade_Jack.png b/Blackjack/BlackjackContent/Spade_Jack.png new file mode 100644 index 0000000..e076e86 Binary files /dev/null and b/Blackjack/BlackjackContent/Spade_Jack.png differ diff --git a/Blackjack/BlackjackContent/Spade_King.png b/Blackjack/BlackjackContent/Spade_King.png new file mode 100644 index 0000000..f0dc878 Binary files /dev/null and b/Blackjack/BlackjackContent/Spade_King.png differ diff --git a/Blackjack/BlackjackContent/Spade_Nine.png b/Blackjack/BlackjackContent/Spade_Nine.png new file mode 100644 index 0000000..05bf854 Binary files /dev/null and b/Blackjack/BlackjackContent/Spade_Nine.png differ diff --git a/Blackjack/BlackjackContent/Spade_Queen.png b/Blackjack/BlackjackContent/Spade_Queen.png new file mode 100644 index 0000000..7a17cae Binary files /dev/null and b/Blackjack/BlackjackContent/Spade_Queen.png differ diff --git a/Blackjack/BlackjackContent/Spade_Seven.png b/Blackjack/BlackjackContent/Spade_Seven.png new file mode 100644 index 0000000..f0c869d Binary files /dev/null and b/Blackjack/BlackjackContent/Spade_Seven.png differ diff --git a/Blackjack/BlackjackContent/Spade_Six.png b/Blackjack/BlackjackContent/Spade_Six.png new file mode 100644 index 0000000..5d7df03 Binary files /dev/null and b/Blackjack/BlackjackContent/Spade_Six.png differ diff --git a/Blackjack/BlackjackContent/Spade_Ten.png b/Blackjack/BlackjackContent/Spade_Ten.png new file mode 100644 index 0000000..d9e6b57 Binary files /dev/null and b/Blackjack/BlackjackContent/Spade_Ten.png differ diff --git a/Blackjack/BlackjackContent/Spade_Three.png b/Blackjack/BlackjackContent/Spade_Three.png new file mode 100644 index 0000000..ae5d8e6 Binary files /dev/null and b/Blackjack/BlackjackContent/Spade_Three.png differ diff --git a/Blackjack/BlackjackContent/Spade_Two.png b/Blackjack/BlackjackContent/Spade_Two.png new file mode 100644 index 0000000..8b1c387 Binary files /dev/null and b/Blackjack/BlackjackContent/Spade_Two.png differ diff --git a/Blackjack/BlackjackContent/Thumbs.db b/Blackjack/BlackjackContent/Thumbs.db new file mode 100644 index 0000000..5d6ef6b Binary files /dev/null and b/Blackjack/BlackjackContent/Thumbs.db differ diff --git a/Blackjack/BlackjackContent/bg_splash.png b/Blackjack/BlackjackContent/bg_splash.png new file mode 100644 index 0000000..0b2deff Binary files /dev/null and b/Blackjack/BlackjackContent/bg_splash.png differ diff --git a/Blackjack/BlackjackContent/blackjack_logo.png b/Blackjack/BlackjackContent/blackjack_logo.png new file mode 100644 index 0000000..8ac908c Binary files /dev/null and b/Blackjack/BlackjackContent/blackjack_logo.png differ diff --git a/Blackjack/BlackjackContent/button_deal_hover.png b/Blackjack/BlackjackContent/button_deal_hover.png new file mode 100644 index 0000000..af4f1ab Binary files /dev/null and b/Blackjack/BlackjackContent/button_deal_hover.png differ diff --git a/Blackjack/BlackjackContent/button_deal_normal.png b/Blackjack/BlackjackContent/button_deal_normal.png new file mode 100644 index 0000000..dbd8779 Binary files /dev/null and b/Blackjack/BlackjackContent/button_deal_normal.png differ diff --git a/Blackjack/BlackjackContent/button_hit_hover.png b/Blackjack/BlackjackContent/button_hit_hover.png new file mode 100644 index 0000000..c7dc6af Binary files /dev/null and b/Blackjack/BlackjackContent/button_hit_hover.png differ diff --git a/Blackjack/BlackjackContent/button_hit_normal.png b/Blackjack/BlackjackContent/button_hit_normal.png new file mode 100644 index 0000000..3a2f62c Binary files /dev/null and b/Blackjack/BlackjackContent/button_hit_normal.png differ diff --git a/Blackjack/BlackjackContent/button_stay_hover.png b/Blackjack/BlackjackContent/button_stay_hover.png new file mode 100644 index 0000000..ea9c0d5 Binary files /dev/null and b/Blackjack/BlackjackContent/button_stay_hover.png differ diff --git a/Blackjack/BlackjackContent/button_stay_normal.png b/Blackjack/BlackjackContent/button_stay_normal.png new file mode 100644 index 0000000..54e480b Binary files /dev/null and b/Blackjack/BlackjackContent/button_stay_normal.png differ diff --git a/Blackjack/BlackjackContent/card_deck.png b/Blackjack/BlackjackContent/card_deck.png new file mode 100644 index 0000000..9fa1351 Binary files /dev/null and b/Blackjack/BlackjackContent/card_deck.png differ diff --git a/Blackjack/BlackjackContent/cybersoldier.wav b/Blackjack/BlackjackContent/cybersoldier.wav new file mode 100644 index 0000000..9acc6bb Binary files /dev/null and b/Blackjack/BlackjackContent/cybersoldier.wav differ diff --git a/Blackjack/BlackjackContent/game_bgm.wav b/Blackjack/BlackjackContent/game_bgm.wav new file mode 100644 index 0000000..766fbbe Binary files /dev/null and b/Blackjack/BlackjackContent/game_bgm.wav differ diff --git a/Blackjack/BlackjackContent/press_enter_to_start.png b/Blackjack/BlackjackContent/press_enter_to_start.png new file mode 100644 index 0000000..7147725 Binary files /dev/null and b/Blackjack/BlackjackContent/press_enter_to_start.png differ diff --git a/Blackjack/BlackjackContent/scoreboard_bg.png b/Blackjack/BlackjackContent/scoreboard_bg.png new file mode 100644 index 0000000..9309125 Binary files /dev/null and b/Blackjack/BlackjackContent/scoreboard_bg.png differ diff --git a/Blackjack/BlackjackContent/status_blackjack.png b/Blackjack/BlackjackContent/status_blackjack.png new file mode 100644 index 0000000..885bd82 Binary files /dev/null and b/Blackjack/BlackjackContent/status_blackjack.png differ diff --git a/Blackjack/BlackjackContent/status_busted.png b/Blackjack/BlackjackContent/status_busted.png new file mode 100644 index 0000000..2dabfdf Binary files /dev/null and b/Blackjack/BlackjackContent/status_busted.png differ diff --git a/Blackjack/BlackjackContent/status_stay.png b/Blackjack/BlackjackContent/status_stay.png new file mode 100644 index 0000000..a43addb Binary files /dev/null and b/Blackjack/BlackjackContent/status_stay.png differ diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..2e082cf --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,7 @@ +Copyright 2014 John Espiritu + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..1879bab --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Blackjack Game + +Blackjack is a video game simulation of the Blackjack casino card game. + +## Status + +This program was developed as a project for a CS course. It is archived for historical purposes and is no longer being maintained or updated. + +## Author + +John Espiritu \ No newline at end of file