Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
JavaScript War card game project from Scratch
Rating: 4.4 out of 5(57 ratings)
6,541 students

JavaScript War card game project from Scratch

Explore how to build this JavaScript Game from Scratch based on the card game war. Step by step learning JavaScript
Created byLaurence Svekis
Last updated 11/2024
English

What you'll learn

  • build an application from scratch
  • learn to apply JavaScript code
  • use JavaScript within web applications

Course content

2 sections22 lectures2h 5m total length
  • Introduction to JavaScript Game Project Course2:47
  • course setup and resources4:22
  • Build structure for gameplay5:44
  • eventlisteners in JavaScript DOM9:59

    Build a JavaScript deck of cards, initialize game state, and enable interactions with DOM listeners using querySelector and getElementById on a fight button. Learn dealing, shuffling, and two-player arrays.

  • Source Code0:18
  • build deck of cards10:03
  • Random Array Shuffle Cards9:13

    Learn to shuffle a deck of cards by creating a generic shuffle function that swaps array items using Math.random and Math.floor, producing a randomized card order.

  • Source Code0:30
  • Modulus and Multidimensional Arrays8:44

    Learn to deal a shuffled deck, use modulus to split cards between two players, and build a multidimensional players array in the JavaScript war card game project.

  • Source Code0:34
  • card shift and storage to inplay array5:16
  • Create Card output for players10:26

    Develop card outputs for players by rendering card data into each player's hand with the document query selector and styling suits and colors with CSS.

  • CSS styling playing cards10:24
  • Card battle check for winner9:50
  • Source Code1:30
  • Create Battle Mode loop JavaScript functions6:40
  • debugging and tweaking6:21
  • add automation tweaks to gameplay9:31
  • Source Code1:56
  • Code overview conclusion8:19

    Finalize the war card game by separating JavaScript into a script file and styling into CSS, linking them, and detailing the game loop, card dealing, and winner logic.

Requirements

  • basic HTML and CSS
  • Basic JavaScript understanding
  • Computer access

Description

Learn how to use JavaScript to build a web project from Scratch!

This course will demonstrate how to build a complete interactive web card game from start to finish.  All the source code is included . Learn from setup to completion step by step tutorials.

Basic JavaScript and CSS is required as the scope of this course is to demonstrate working with JavaScript to build web applications.

This course is perfect to learn more about writing JavaScript within a fun dynamic project.  Learn the core concepts of web development and how to apply JavaScript to make your project come to life.

The best way to learn is to practice and this project is a great place to start and challenge yourself to see what you can do with JavaScript.   Card war is a simple game with straight forward rules and it makes a great digital project.  The rules require a dealing of cards to each player, then taking the top card and seeing which player has the highest card.  The high card wins the pot and the won cards then go to the bottom of the players stack.  The first player to run out of cards loses!   Within the course we simulate this game using the rules and apply them with JavaScript.  Using functions, ternary statements, loops, intervals, variables, arrays, objects together to build the game.

Learn by examples - source code is included to get you started quickly

Taught by an instructor with over 18 years of JavaScript experience, ready to help you learn JavaScript and answer any questions you may have.  Regular Q&A discussions with daily responses and coding assistance.

Everything you need to learn how to build this and applications like it!

When you are ready to learn more about building JavaScript applications from scratch, join now and lets start building amazing things online.  


Who this course is for:

  • JavaScript beginners
  • Anyone who wants to learn more about using JavaScript
  • Web developers