-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed the bug that does not display dealer hand when game has ended
- Loading branch information
Showing
4 changed files
with
26 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,50 @@ | ||
"use strict"; | ||
|
||
// Importing functions and event handlers | ||
import {gameInit} from "./functions/gameInit.mjs"; | ||
import {initiateGameStartSequence} from "./eventHandlers/startGameSequenceHandler.mjs"; | ||
import {clearStakeButtonClick, playBtn, removePopup, showPopup} from "./eventHandlers/stakeHandler.mjs"; | ||
import {hitBtn} from "./eventHandlers/hitHandler.mjs"; | ||
import {restartGame} from "./eventHandlers/restartHandler.mjs"; | ||
import {populateDeckWithImages} from "./functions/uiFunctions.mjs"; | ||
import {newGame} from "./eventHandlers/newGameHandler.js"; | ||
import {standBtn} from "./eventHandlers/standHanler.mjs"; | ||
import {balance} from "./functions/balance.mjs"; | ||
import {betMinMax} from "./functions/gameFunctions.mjs"; | ||
|
||
|
||
// Constants for stake percentages | ||
export const percent = [0.05, 0.1, 0.3, 0.4, 0.5]; | ||
|
||
// initialize the game | ||
gameInit() | ||
// Initialize the game | ||
gameInit(); | ||
|
||
// Start the game sequence | ||
initiateGameStartSequence(); | ||
|
||
// Restart the game | ||
restartGame(); | ||
|
||
restartGame() | ||
|
||
// Play event listener | ||
playBtn() | ||
// Play button event listener | ||
playBtn(); | ||
|
||
newGame() | ||
// New game event listener | ||
newGame(); | ||
|
||
clearStakeButtonClick() | ||
// Clear stake button click event | ||
clearStakeButtonClick(); | ||
|
||
removePopup() | ||
// Remove popup event | ||
removePopup(); | ||
|
||
// Show popup if balance is insufficient | ||
if (balance < betMinMax(balance).minBet) { | ||
showPopup("You are out of credits.") | ||
|
||
removePopup() | ||
showPopup("You are out of credits."); | ||
removePopup(); | ||
} | ||
|
||
// hit btn event listener | ||
hitBtn() | ||
// Hit button event listener | ||
hitBtn(); | ||
|
||
standBtn() | ||
// Stand button event listener | ||
standBtn(); | ||
|
||
doubleBtn() |