Coder Social home page Coder Social logo

mtgnode's Introduction

Magic the Gathering for Node.js

Version 0.3.0

About

MTG Node is a personal experiment with node.js and socket.io. My intention is to create a simple web application enabling you to play Magic the Gathering with friends through a web browser. My goal is not to enforce the rules of the game whatsoever but just to provide a digital interface that could be played the same way you would with real cards.

The application is still pretty ugly and basic but does the job.

Warning

You should use a modern web browser (Chrome, Firefox and Safari would do the trick - forget right away about Internet Explorer you fool). You should also use a quite modern computer since the game makes use of 3D rotations and since a old computer will not render the game correctly otherwise. I will develop fallbacks later on.

Also, note that this application is not secured in any way and should not be used to launch a server on the Internet. I recommend its use through LAN only.

Installation

To start the server on which every one will connect, you need to install node.js.

Once this is done, you'll have to install some npm packages.

# Use sudo if you run into access rights errors
npm install -g grunt-cli grunt bower

Finally clone this repository and install the dependencies likewise.

git clone [email protected]:Yomguithereal/mtgnode.git
cd mtgnode
npm install
bower install

Usage

To launch the server. Enter the proper directory and launch the following command.

node app

By default, the application will be available on localhost:3000 (url to type in your browser).

To create your first user, connect to the server on your web browser and type the following url.

localhost:3000/user/create?username=YOUR-USERNAME

Then, access the login page through localhost:3000 and click on the relevant button to log in.

If you want other people to connect to your server (on a LAN, typically), just give them your local IP address and let them type it on their browser with port 3000.

#  Example
192.168.1.13:3000

Pages

Once connected, you have access to four differents locations.

  • A main lobby displaying hosted games and serving as a hub for other pages.
  • A deck-builder enabling you to search cards and create decks for your user.
  • A game debugging zone (basically, you will play against yourself in a mirrored fashion).

Game Controls

You are always the bottom player on your screen.

To draw a card, click the deck. Then drag the card where you want.

You also have access to some contextual actions with your right click.

Database

This application runs without a database server and keeps a json file of its user and decks data. So, if you want to save or transfer the data from one of your instances to another one, the file is located at database/mtgnode.db.

Card display driver

This application does not provide the cards images so it can stay lightweight. In order to display card, it uses what is called a driver which will fetch the required images on some remote site hosting them.

Available drivers

  • mtgimage (default)
  • magiccards.info
  • gatherers

Changing the driver

To change the display driver, go to config/mtgnode.js and change for the wanted driver.

##Thanks This app runs on mtgjson's data.

mtgnode's People

Contributors

yomguithereal 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.