# Score board for BlackJack Game Points trouble

**URL:** <https://forum.kirupa.com/t/score-board-for-blackjack-game-points-trouble/325578>\
**Category:** Uncategorized\
**Created:** [October 24, 2011, 3:14pm UTC](https://forum.kirupa.com/t/score-board-for-blackjack-game-points-trouble/325578 "2011-10-24T15:14:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mchamber](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@mchamber](https://forum.kirupa.com/u/mchamber)\
**Post date:** [October 24, 2011, 3:14pm UTC](https://forum.kirupa.com/t/score-board-for-blackjack-game-points-trouble/325578/1 "2011-10-24T15:14:34Z")

</div>

I am creating a blackjack game and almost have it all figured out besides the scoreboard. When I win the game it adds the 25 points and when I loose it subtracts the 25 points from the starting score = 200. The problem is that if you win multiple times in a row or lose multiple times in a row the score doesn’t keep adding up. It only adds or subtracts the score once. I tried using a boolean code but can’t get it to work right. Now I am using this set up. Any Ideas??

var playerMoney:Number;

function showScore():void  
{  
player\_txt.text = "Player: " + playerMoney;  
}

function initializeGame():void  
{  
playerMoney = 200;  
}

function checkWin():void  
{  
var tempCard:MovieClip;  
playerScore = calculateScore(playerCards);  
if(playerScore \<= 21 && message\_txt.text == “”)  
{  
dealerScore = calculateScore(dealerCards,true);  
}

```
for(var i:uint = 0; i &lt; dealerCards.length; i++)
{
	tempCard = MovieClip(dealerContainer.getChildAt(i));
	tempCard.gotoAndStop(dealerCards*.cardType);
	tempCard.value_mc.gotoAndStop(dealerCards*.cardName);
}

if(playerScore == dealerScore)
{
	message_txt.appendText("It's a tie!");
}
else if(playerScore &lt;= 21 && (playerScore &gt;= dealerScore || dealerScore &gt; 21))
{
	message_txt.appendText("Player Wins!");
	playerMoney +=25;
	showScore();
	
}
else
{
	message_txt.appendText("Dealer Wins!");
	playerMoney -=25;
	showScore();
	
}

hit_btn.removeEventListener(MouseEvent.CLICK, hitMe);
stay_btn.removeEventListener(MouseEvent.CLICK, stay);
deal_btn.addEventListener(MouseEvent.CLICK, startGame);

```

}
