Skip to content

Commit

Permalink
Added cards, changed some of the GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
emil45 committed May 31, 2016
1 parent 06b1760 commit 010e399
Show file tree
Hide file tree
Showing 22 changed files with 56 additions and 44 deletions.
9 changes: 4 additions & 5 deletions app/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ html {
background-repeat: no-repeat;
}

#wood {
background: url("../img/wood.png");
background-repeat: no-repeat;
}

.start-game-buttons {
display: inline-block; !important;
margin-right: 5px;
Expand All @@ -32,6 +27,10 @@ html {
width: 85%; !important;
}

.text-white {
color: white;
}

.centered {
position: fixed;
top: 50%;
Expand Down
Binary file added app/fonts/cards/suit-regular.ttf
Binary file not shown.
Binary file added app/fonts/cards/suit-regular.woff
Binary file not shown.
5 changes: 0 additions & 5 deletions app/img/README

This file was deleted.

Binary file removed app/img/back.png
Binary file not shown.
Binary file removed app/img/big-joker.png
Binary file not shown.
Binary file removed app/img/face-jack-club.png
Binary file not shown.
Binary file removed app/img/face-jack-diamond.png
Binary file not shown.
Binary file removed app/img/face-jack-heart.png
Binary file not shown.
Binary file removed app/img/face-jack-spade.png
Binary file not shown.
Binary file removed app/img/face-king-club.png
Binary file not shown.
Binary file removed app/img/face-king-diamond.png
Binary file not shown.
Binary file removed app/img/face-king-heart.png
Binary file not shown.
Binary file removed app/img/face-king-spade.png
Binary file not shown.
Binary file removed app/img/face-queen-club.png
Binary file not shown.
Binary file removed app/img/face-queen-diamond.png
Binary file not shown.
Binary file removed app/img/face-queen-heart.png
Binary file not shown.
Binary file removed app/img/face-queen-spade.png
Binary file not shown.
68 changes: 37 additions & 31 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,51 +26,59 @@

</head>
<body ng-controller="ngGame" style="">
<div class="playingCards faceImages rotateHand">
<ul class="hand">
<li>
<a class="card rank-8 hearts">
<span class="rank">8</span>
<span class="suit"></span>
</a>
</li>
<li>
<a class="card rank-q hearts">
<span class="rank">Q</span>
<span class="suit"></span>
</a>
</li>
<li>
<a class="card rank-k spades">
<span class="rank">K</span>
<span class="suit"></span>
</a>
</li>
</ul>
</div>
<div class="container centered">
<div class="row center">
<div>
<span>Dealer Sum of Cards: {{dealerHandSum}}</span>
<span class="text-white">Dealer Sum of Cards: {{dealerHandSum}}</span>
</div>
<div>
<span>Dealer Cards: <span ng-repeat="card in dealerCards">{{card}}</span></span>
<div class="col l4">
<div class="playingCards faceImages rotateHand">
<ul class="hand">
<li></li>
<li></li>
<li></li>
<li></li>
<li ng-repeat="card in dealerCards">
<a class="card rank-{{card.getRank()}} {{card.suit}}">
<span class="rank">{{card.getRank()}}</span>
<span class="suit"></span>
</a>
</li>
</ul>
</div>
<span ></span></span>
</div>
</div>
</div>

<div class="row center">
<div class="col l4">
<span>Player Sum of Cards: {{player.handSum}}</span>
<span class="text-white">Player Sum of Cards: {{player.handSum}}</span>
</div>
<div class="col l4">
<span>Cards: <span ng-repeat="card in player.hand">{{card}}</span></span>
<div class="playingCards faceImages rotateHand">
<ul class="table">
<li></li>
<li></li>
<li></li>
<li></li>
<li ng-repeat="card in player.hand">
<a class="card rank-{{card.getRank()}} {{card.suit}}">
<span class="rank">{{card.getRank()}}</span>
<span class="suit">{{"&" + card.getSuit() + ";"}}</span>
</a>
</li>
</ul>
</div>
<span ></span></span>
</div>
<div class="col l4">
<span>Wins: {{player.wins}}</span>
<span>Loses: {{player.loses}}</span>
<span class="text-white">Wins: {{player.wins}}</span>
<span class="text-white">Loses: {{player.loses}}</span>
</div>
</div>
<div>
<div class="text-white">
<div id="deal" class="row center animated zoomInDown" ng-hide="startGame">
<a class="waves-effet waves-light light-green lighten-1 btn" ng-click="dealCards()">Deal</a>
</div>
Expand Down Expand Up @@ -102,7 +110,5 @@
</div>
</div>
</div>
<div id="wood"> </div>

</body>
</html>
14 changes: 13 additions & 1 deletion app/js/services/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@ BlackJack.factory('Card', function () {
};

Card.prototype.getRank = function () {
return this.rank;
switch (this.rank) {
case 1:
return 'A';
case 11:
return 'J';
case 12:
return 'Q';
case 13:
return 'K';
default:
return this.rank;

}
};

Card.prototype.getSuit = function () {
Expand Down
2 changes: 1 addition & 1 deletion app/js/services/deck.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BlackJack.factory('Deck', function (Card) {

var suits = [ 'heart', 'diamond', 'spade', 'club'];
var suits = [ 'hearts', 'diams', 'spades', 'clubs'];
var ranks = [1, 2 ,3 , 4 , 5 ,6 ,7 , 8 ,9 ,10, 11 ,12 ,13];

var Deck = function (numOfDecks) {
Expand Down
2 changes: 1 addition & 1 deletion app/js/services/strategy-tables/surrenderAgainst2to10.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ BlackJack.factory('surrenderAgainst2to10', function () {
[hit, hit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, hit, hit, hit, hit],
[hit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, hit],
[hit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit, doubleOtherwiseHit],
[hit, hit, stand, stand, stand, hit, hit, hit, hit, hit],
[hit, hit, hit, stand, stand, stand, hit, hit, hit, hit],
[hit, stand, stand, stand, stand, stand, hit, hit, hit, hit],
[hit, stand, stand, stand, stand, stand, hit, hit, hit, hit],
[hit, stand, stand, stand, stand, stand, hit, hit, hit, surrenderOtherwiseHit],
Expand Down

0 comments on commit 010e399

Please sign in to comment.