Giter Site home page Giter Site logo

mooncraft's Introduction

Mooncraft

Somewhere in the seventh millenia, long after Humans have become extinct, only a select few plants appear to have survived Solar Radiation.

A new breed of seemingly sentient beings has emerged due to centuries of mutations from radiation exposure. They call themselves "Ents", live in "The Garden" and follow the teachings of their oldest member, the "Tree of Knowledge".

Status: Player and Region interaction is in progress.

Game Play

Demo

Play MoonCraft

Action

  • Harvest line-of-sight by pressing h
  • Investigate line-of-sight by pressing i
  • Toggle notifications console by pressing ESC

Movement

  • Left by pressing Left Arrow or a or NUM 4
  • Right by pressing Right Arrow or d or NUM 6
  • Up by pressing Up Arrow or w or NUM 8
  • Down by pressing Down Arrow or s or NUM 5
  • Upleft by pressing q or NUM 7
  • Upright by pressing e or NUM 9
  • Downleft by pressing z or NUM 1
  • Downright by pressing c or NUM 3

Installation

Development

  • npm install
  • redis-server --port 6379
  • npm run dev runs the development environment using webpack-dev-server + hot reload
Redis Recipes
  • Change cycle PUBLISH cycling '{"cycle":"morning|afternoon|evening|night"}'
  • Get all players data HGETALL player
  • Get all player ids HKEYS player
  • Get one player HGET player <id>
  • Delete one player HDEL player <id>
  • Delete all players DEL player'
  • Get all region ids HKEYS region
  • Get one region HGET region <id>
  • Delete one region HDEL region <id>
  • Delete all region DEL region'

Deployment

  • Both a npm run start script and Procfile are included for Heroku or custom deployment.
  • npm run dist builds the production distribution package for JS, CSS and other assets

Requests And Responses

Query Player

Request
socket.emit('query', data)
data = {
  "type": "player"
}
Response
socket.on('query', callback)
{
  "type": "player",
  "data": {
  	"name": "Nyan",
    "icon": "default",
    "region": {
        "id": "CG",
    	"x": 1,
        "y": 1
    },
    "inventory": {}
  }
}

Query Region

Request
socket.emit('query', data)
data = {
  "type": "region",
  "id"  : "CG"
}
Response
socket.on('query', callback)
{
    "type": "region",
    "data": {
    	"id": "CG",
        "name": "The Garden",
        "description": "The World's Last Safe Haven.",
        "tiles": [],
        "nodes": [],
        "items": []
    }
}

Query Cycling

Request
socket.emit('cycling', data)
data = {}
Response
socket.on('query', callback)
{
    "type": "cycling",
    "data": {
    	"cycle": "evening"
    }
}

Enter

Request
socket.emit('enter', data)
data = {
  "id": "CG"
}
Response
socket.on('query', data)

Leave

Request
socket.emit('leave', data)
data: {
  "id": "CG"
}
Response
socket.on('query', data)

Move

Request

socket.emit('move', data)

{
  "id": "CG",
  "x" : 1,
  "y" : 2
}
Response
socket.on('query', data)

Investigate

Request
socket.emit('investigate', data)
data = {
  "id": "RegionID",
  "x" : 1,
  "y" : 2
}
Response
socket.on('query', data)

Say

Request
socket.emit('say', data)
data = {
  "id": "CG",
  "message" : "Hello World!"
}
Response
socket.on('say', data)

Harvest

Request
socket.emit('harvest', data)
data = {
  "id": "CG",
  "x" : 1,
  "y" : 2
}
Response
socket.on('query', data)

Build

Request
socket.emit('build', data)
data = {
  "id"  : "CG",
  "x"   : 1,
  "y"   : 2,
  "type": 100
}
Response
socket.on('query', data)

Credits

Credits and relevant licenses for game art, music and sounds included in the credits directory. Thank you! :3

mooncraft's People

Contributors

nyanofthemoon avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

ziad-saab

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.