Giter VIP home page Giter VIP logo

x-wars's Introduction

x-wars

A generic JavaScript * wars engine. Inspired by Drugwars.

Installation

Assuming Node.js and npm are installed, clone this repo and run from the command line:

cd x-wars
npm install

Scripts

npm test

Runs all tests.

npm start

Lints and builds the JavaScript into a distributable file in dist.

npm run test:watch

Runs tests in watch mode in response to changes to any JavaScript file in the src or test directories.

npm run lint

Lints the JavaScript code in src and test directories.

npm run build

Builds the module into a single file in dist.

Command-line demo

On a UNIX-like system (including Mac), run this once:

chmod u+x demo/index.js

Then to play the demo:

demo/index.js

game elements

  • time (30 days, 1 day per move)
  • six locations
  • six items to buy/sell
  • space for items (100) (randomly offered)
  • starter money/loan ($2000)
  • weapons (0 at start) (randomly offered)
  • loan sharks
  • vs cops: get arrested, run, fight
  • $ award for killing cop
  • random: muggin, increased drug prices, finding of drugs
  • final score: current amount cash * 2, then number of millions out of 100. So $25,000,000 = 50/100.

typical game commands

  • X reset
  • X go (location; time decrements)
  • X buy (item)
  • X sell (item)
  • X pay (back loan shark)
  • X borrow (from loan shark)
  • X finish (time out)

game commands for special events

  • buy (weapon, storage)
  • surrender/flee/fight (cops, muggers)

possible future game commands

  • deposit (to bank)
  • withdrawal (from bank)

properties

  • data (private) / or just use WeakMap

loans

I = P * r * t Interest earned = Princial * rate * time

x-wars's People

Contributors

adrianlafond avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

xxd4rkc0d3rxx

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.