Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
JavaScript DOM Game Blackjack JavaScript Game from Scratch
Highest Rated
Rating: 4.9 out of 5(11 ratings)
152 students

JavaScript DOM Game Blackjack JavaScript Game from Scratch

Explore JavaScript Document Object Model web page element updates manipulation using JavaScript code to create a GAME
Created byLaurence Svekis
Last updated 11/2024
English
English [Auto],

What you'll learn

  • how to apply JavaScript to create DOM based Game
  • JavaScript coding
  • Update and manipulate web page element using JavaScript

Course content

2 sections50 lectures2h 51m total length
  • Introduction to JavaScript BlackJack game2:22

    Build a fully functional blackjack game from scratch using JavaScript and DOM manipulation. Practice hit and stand, betting, dealer logic, and updating the UI with minimal HTML and CSS.

  • Web Developer Setup HTML.2:28

    Set up your web development environment with brackets and chrome dev tools, create an index page with a game div, and link the javascript and style files.

  • HTML Source Code0:03
  • Get coding JavaScript5:17

    Write and link a separate script.js file, load the DOM content safely with a DOMContentLoaded event, and test output with console logs to prepare for browser-based debugging.

  • Source Code0:04
  • DOMContentLoaded run app code4:19

    Utilize the DOMContentLoaded event to initialize a self-invoking app object that runs on page load, separating the core game logic from other javascript.

  • JavaScript App Source Code0:07
  • Game Variables Element Building8:21

    Build the blackjack UI by creating and appending DOM elements with JavaScript, using querySelector and createElement to render a dealer vs. player scoreboard.

  • Source JS0:06
  • Remove HTML only JavaScript8:32

    Learn to build a blackjack game user interface entirely with JavaScript by dynamically creating and appending elements, including dealer and player cards, updating scores, and wiring event listeners.

  • Create Elements JavaScript Source0:14
  • HTML buttons with JavaScript8:50

    Learn to build a blackjack-style game UI by creating and appending DOM elements with JavaScript, including a dashboard, status messages, deal, hit, stand buttons, and a bet input.

  • Source Code JS document maker0:28
  • Deck of Cards.8:57

    Construct a dynamic 52-card deck by defining suits and ranks, building the deck via a function, and creating card objects with suit, rank, and value, including ace and face cards.

  • Source Code0:45
  • Shuffle Deck of Cards.5:11

    Learn to shuffle a deck of cards by sorting an array in place, and using a compare function or math.random to randomize order, with practical deck examples.

  • Source Code Sort Random0:12
  • Add Event listeners to Buttons.4:13

    Connect the existing game buttons to click listeners, implement deal, hit, stand, and next card functions, manage dealer and player hands, and toggle button availability as the game starts.

  • Button Toggle On Off.2:38

    Create reusable DOM button toggling functions to enable or disable blackjack controls, update button colors, and manage deal, hit, and stand states as the game progresses.

  • Source Code Event Listeners0:56
  • Dealing of Cards4:03

    Implement a takeCard function to deal top cards from a randomized deck into a hand, update the dealer area, and hide cards when needed for blackjack.

  • Source Code0:06
  • Show card on WebPage7:28

    Show a card on a web page by building a showCard function that creates DOM elements, styles color by suit, and displays rank and suit for dealer and player.

  • Source Code1:12
  • Element CSS4:50

    Link a new style sheet to style the blackjack game's UI with classes card, big, tiny, and message for borders and spacing, and set fonts and button styles.

  • CSS Source Code0:17
  • Hide Top Card4:01

    Learn to hide the dealer's top card by overlaying a cover on the card back, toggle visibility with a boolean, and ensure a fresh deck is built when empty.

  • Source Code1:15
  • Begin Game Play Conditions Part 1.6:26

    Implement begin game play conditions for a JavaScript blackjack game by dealing hands, updating player and dealer scores, calculating totals (including aces), and enabling hit or stand under 21.

  • Source Code0:09
  • Begin Game Play Conditions part 27:50
  • Source Code1:40
  • Add Game Player options3:42

    Design and wire player options in a dom blackjack game, enabling deal, hit, and stand, updating scores, disabling controls at bust, and initiating dealer play toward 17 or bust.

  • Source Code1:42
  • Dealer Playing Game3:57

    Implement dealer logic in the blackjack game by drawing until reaching 17 or bust, reveal the dealer's hidden card, update the dealer score, compare hands, and declare the winner.

  • Source Code1:45
  • Find the Game Winner5:52

    Implement the find winner logic in a blackjack game, calculating player and dealer scores, handling busts, and determining the winner after stand and dealer play.

  • Source Code1:59
  • Game Tweaks and Adjustments.4:25

    Update the blackjack game's scoreboard using a two-value score array and a scoreboard function. Use template literals to display player and dealer scores, and disable actions after busts.

  • Source Code2:04
  • Game Bets and scoring7:13

    This lesson adds cash tracking and betting to the blackjack game, starting the player with 100, validating bets, locking wagers during play, and updating cash and status after each bet.

  • Source Code2:16
  • GamePlay Updates.6:33

    Lock the wager during card dealing, disable the bet input and gray out the button; update cash on wins or draws and check for dealer blackjack to determine the winner.

  • Source Code JS2:30
  • Final Updates3:20

    Apply final updates to the blackjack game by fixing dealer score updates, hidden cards, and cash handling, then test hitting, standing, betting, and dealer outcomes before the final code review.

  • Final JS Source Code2:32
  • Final Code Review10:32

    Review and refine a blackjack game built in JavaScript from scratch, including deck creation, shuffling, dealing, ace scoring, and betting, with a self-contained app object and dynamic DOM updates.

Requirements

  • HTML and CSS
  • Basic JavaScript core fundamentals
  • Computer access
  • Programming expereince

Description

Explore how you can create a JavaScript DOM based game from scratch using JavaScript

Update and manipulate web page element with JavaScript Code - No libraries No tricks all JavaScript

This course focuses on JavaScript

  • Create elements and add them to your web page using JavaScript - Yes loaded with examples and way to do this easily.

  • Add event listeners to create interactive content using JavaScript

  • Dynamic content and interactions updating web page elements

  • Do more with JavaScript - Learn to apply JavaScript best of all while build a FUN INTERACTIVE GAME

  • Blackjack game - Easy to create with simple rules

  • Create visual cards using CSS

  • Apply styles, classes and interactions to elements

Step by step learning - everything you need to create YOUR OWN VERSION OF THIS GAME!!!!

Learn how to add functions that run the code in sequence to make a game

Learn more about game design along the way

Taught by an instructor with many years of REAL WORLD web development experience - READY to HELP YOU LEARN

Fast friendly support is always available within the Q&A section

What are you waiting for - you have nothing to lose!!!

BUILD YOUR OWN VERSION of the GAME TODAY!!!!

Source code is included step by step so you can copy the code try it out and get a feel for what JavaScript is doing.


Who this course is for:

  • JavaScript developers
  • Application developers
  • Anyone who wants to create a project with JavaScript