GithubHelp home page GithubHelp logo

monsters's Introduction

Monsters

A Javascript CLI game that pits a load of monsters against one another in a battle to the death. Run to the hills the monsters are coming!

Game Screenie

Installing

The project can be run either in development mode or by installing globally. To stay honest to the spec the CLI invocation accepts the total number of monsters to unleash as an argument but for a nicer user experience its also possible to run without any args and decide how many monsters to unleash via the command line interface.

To install run:

npm i [-g] && npm run setup world_map_small.txt|world_map_medium.txt

To run in development mode:

npm start [monsters]

To run from a global installation:

monsters [monsters]

In both cases the monsters argument is optional and if passed, should contain an integer.

Running the tests

npm run test

Building

The application is compiled into a CJS module using rollup. To generate a new distribution run:

npm run build

Assumptions

  • All city names have a length greater than 0
  • If monsters start in the same city they immediately fight and destroy the city

Design Decisions

Parsing the text file on each game run seemed like an unnecessary overhead so this is only done once on install.

The map the game uses can be changed by re-running the following command:

npm run setup world_map_small.txt|world_map_medium.txt

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.