Giter Site home page Giter Site logo

monopoly.js's Introduction

Monopoly.js

GitHub release

Implementation of monopoly game with javascript.

Demo

View Demo Here

Setup

Add monopoly.js file into your html and run:

Monopoly.load();

By default the script will target body DOM and load a game into it. However, you can set loadTarget parameter into the loader function to change target. For example:

<script>
  Monopoly.load({ loadTarget: "#loadHere" });
</script>

<div id="loadHere"></div>

monopoly.js's People

Contributors

piriys avatar

Stargazers

azimolab avatar Melissa Ann Sorrells avatar Fly Man avatar

Watchers

 avatar

Forkers

dhdavidhsu

monopoly.js's Issues

Implement Rules for Double Rolls

If a player rolls double, they get to roll again. If the player gets double three times consecutively, put the player to jail.

Refactor Game Class to Use Map()

  • spaces field of game class is still used to check if player owns all property in color group when checking if they can be upgraded in space.resolve().

Bookmarklet Implementation

Implement a bookmarklet that allows user to click on and load the entire game onto any page.
The code below loads in the script tag but nothing happens when Monopoly.load is called.

javascript:(function()%7Bfunction%20callback()%7BMonopoly.load()%7Dvar%20s%3Ddocument.createElement(%22script%22)%3Bs.src%3D%22https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Fpiriys%2FMonopoly.js%40v1.0.1%2Fmonopoly.js%22%3Bif(s.addEventListener)%7Bs.addEventListener(%22load%22%2Ccallback%2Cfalse)%7Delse%20if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()

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.