A JavaScript War Card Game Project from Scratch [Video]
-
Free ChapterIntroduction to Building a Card War game from scratch
- Introduction to JavaScript Game Project Course
- course setup and resources
- Build structure for gameplay
- event listeners in JavaScript DOM
- build deck of cards
- Random Array Shuffle Cards
- Modulus and Multidimensional Arrays
- card shift and storage to inplay array
- Create Card output for players
- CSS styling playing cards
- Card battle check for winner
- Create Battle Mode loop JavaScript functions
- debugging and tweaking
- add automation tweaks to gameplay
- Code overview conclusion
This course will walk you through how to set up a complete interactive web card game from start to finish. All the source code is included so you can go from setup to completion via step-by-step tutorials. Basic JavaScript and CSS knowledge is required as the scope of this course is to demonstrate using JavaScript to build web applications. This course is a perfect fit when it comes to learning more about writing JavaScript within a fun dynamic project. You'll learn the core concepts of web development and how to apply JavaScript to make your project come to life.
Style and Approach
This course demonstrates how to build a complete interactive web card game from start to finish. 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. War is a simple game with straightforward rules and makes a great digital project. The rules require dealing 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 remaining cards then go to the bottom of the player's 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, and objects in unison to build the game. The source code is also included.
- Publication date:
- September 2018
- Publisher
- Packt
- Duration
- 1 hour 57 minutes
- ISBN
- 9781789809459