Giter Club home page Giter Club logo

fun-top-trumps-battler's Introduction

Top Trumps Card Game

Using the Object Oriented Programming skills you've learned this week, we want you to implement the classic Top Trumps card game!

Day 1

In day 1 of this sprint you are expected to use the pseudo-classical pattern of object creation in order to create your cards, collectors and game objects. Remember to think about which properties and methods should belong to each of these different objects.

Day 2

In day 2 of this sprint you should re-factor your code to make use of ES6 classes. Any code that uses the pseudo-classical pattern of object creation should be re-factored into classes.

Cards

  • Each card should have a name, and five attributes attached to it
  • Each card should have a type property, only cards of the same type can play against each other.
  • Every card should have a quote method available, which returns its quote.
  • Every card should have a funFact method available, which returns its fun fact.

Collector

  • Card collectors will have a name, and a way of storing their cards.
  • Each card collector will also have a buy method available, so they can store more cards.

Game

  • Finally, you will need a way to play the cards.
  • The game should take two collectors and the names of the cards they wish to play. The cards should be in an ordered list.
  • The game should have a turn method available. This should take the card at the top of the list with a defined attribute. The attributes on the two opposing cards will then be compared.
  • Whichever card has the larger number for the specific attribute wins the round. The collector who's card that is then steals the losing card. The losing card will be put to the back of their list.
  • The winning card will stay in play, the collector who lost will then play their next card in the list with a specified attribute.
  • Once one of the collectors loses all their cards, the other collector wins.

Type ideas

  • Animals
  • TV show characters
  • Sports stars
  • Countries
  • Movie characters
  • Superheroes

Making the game

Once you have all the necessary parts fully tested, make the game!

Using the inquirer library, build a command line application to play your pokemon battle game. The game should be played using inputs and selections.

Extra Requirements

  • Implement a shuffle method that shuffles the collectors cards.
  • Implement a method to decide who goes first.
  • In the case of a tie between two cards, place these cards into a holding area and play the next turn. Whichever collector wins the next round then steals the previous two cards along with the current playing losing card.

fun-top-trumps-battler's People

Contributors

daviidbartlett avatar nc-paul-rogerson avatar sssam-c avatar dutton1990 avatar p-copley avatar philippaclaire9 avatar dav3rid avatar nc-liam-greenfield avatar dedekind561 avatar tomosim 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.