Code Monkey home page Code Monkey logo

project-1's Introduction

Project 1

War

Gameplay

This is my take on the classic, 2-player card game "War." It's a game in which a shuffled deck is dealt evenly to both players. The players then compare their top cards. The player with the highest card value will take both cards. The game ends when one player has no remaining cards.

You can play the game here.

Technologies Used

For this project I used HTML, CSS and vanilla javascript.

Goals for this project

Bronze Level Goal

  • The game should be able to determine the highest card played
  • The game should add the two played cards to the winner's hand
  • There should be a button that compares the top card from each player's hand when pressed
  • The game should alert that the game is over when one player is out of cards

Silver Level Goal

  • Some DOM manipulation
    • DIVs to represent "flipped cards" (not necessarily styled)
  • Reset button
  • DIVs to represent each player's hand (not necessarily styled)
  • If there is a tie each player keeps the card they played
    • (I ended up scrapping this idea because of the eventual "war on tie" functionality)

Gold Level Goal

  • Styled cards for players hands and for the flipped cards
  • Play "War" if the players tie
    • Play "War" again if the war ends in a tie (continue this until there is a winner)
  • Notification when someone wins
  • Support for multiple players
  • Visuals for "War"

Installation

Simply clone down this repository to a folder on your computer and open the index.html file in your web browser.

Remaining Problems

  • When the player clicks the Player Deck before the cards disappear the graphics from both clicks get meshed together. Then, if they continue to click quickly the cards disappear at an unpredictable rate
    • (This does not affect the game logic, but it looks bad)
  • There is no visual for when "War" is played
  • No notification when someone wins
  • No multiplayer

User Stories

  1. As a user I would like to see which cards are played when I click.
  2. As a user I would like to be able to reset the game so I can start over if I want/need to.
  3. As a user I would like to be notified of the current state of the game so I know what is happening behind the scenes.

project-1's People

Contributors

pkmoran avatar

Watchers

James Cloos avatar Nicholas Olds avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.