/The-Game-of-War

Card game - War

Primary LanguageCSS

This is the Game of War!

This is a fun and exciting card game played by two players!... The object of the game is too win all the cards in the deck.

Game Play Instructions

The object of this game is to win all the cards in the deck! Two players will be dealt the full deck of cards evenly and face down. Both players will flip 1 card at the same time, whoever has the highest... card wins that round and takes the cards on the table. The card values go from highest to lowest. Ace, King, Queen, Jack, 10, 9, 8, 7, 6, 5, 4, 3, 2. War happens when both players turn over the same value of card. Once in War, both players will flip 3 cards face down and 1 card face up. The winner is the player with the highest card, if both cards are equal in... value another war begins! The winner will take all the cards on the table. The game is won when one player has aqcuired all the cards in a deck.

Technologies Used:

For this game I used JavaScript, HTML, CSS.

Pseudo Code for Game of War

  1. Define required constants: 1.1 Define a card deck, 1.2 Define Player 1, 1.3 Define Player 2, 1.4 Define Game Win
  2. Define required variables used to track the state of the game: 2.1 Define War Array 2.3 Define player1 card 2.4 Define player2 card 2.3 Need to find round winner 2.4 Define Game Win
  3. Store elements on page that will be accessed in code more than once in variables to make code more consise. 3.1 Store player1 deck 3.2 Store player2 deck 3.3 Store a msg section 3.4 Store a replay section
  4. Upon Loading the app should: 4.1 Initialize the state variables 4.2 Deal the deck to both players 4.3 Show each card as it is played 4.4 Display a round winner text 4.5 Display a game over text

Future Edits

I would like to add animation to the cards as they are being moved along the board. I would like to incorporate sound to the different functions of the game.