Giter Site home page Giter Site logo

gesellix / lunacy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sander/lunacy

0.0 3.0 0.0 2.48 MB

Werewolves game for Chrome and iOS using CouchDB, Node.js and AngularJS.

Home Page: http://playlunacy.com/

JavaScript 30.33% CSS 62.50% Objective-C 7.17%

lunacy's Introduction

Lunacy

Copyright 2012-2013 Sander Dijkhuis. The source code is available under an Apache 2.0 license.

The artwork used in Lunacy is not available under an open source or free software license. You can download dl.playlunacy.com/visuals.zip and extract it to the visuals/ directory for testing.

Developing the gameplay

  1. Start a web server that hosts the Lunacy folder, for example using Mongoose in Windows.
  2. Go to the test page using Chrome. The URL is localhost:8080/html/index.inmem.html if you use Mongoose.

Installing the extension

  1. In Chrome, visit chrome://extensions.
  2. Make sure Developer mode is enabled in the upper right corner.
  3. Click the Load unpacked extension… button.
  4. Select the lunacy folder that you have synced using GitHub or git.

You can now launch the new Lunacy in the same way as you launch the old Lunacy. Note that they have the same icon.

To load updated code, press ctrl+R (or any other key combination you use for reloading) while Lunacy is running.

Making a new Chrome release

  1. Update the version number in manifest.json.
  2. Run v=VERSION tools/release.sh, where VERSION is the same number as in manifest.json.
  3. Upload dist/VERSION.zip to the Chrome Web Store.

Game data schema

Games are split up into multiple CouchDB documents, that are selectively synched to user databases.

See schema.png.

File structure

- html/                        client-side files
  - images/                    redistributable images
  - js/                        JavaScript scripts, including standard Angular scripts
  - less/                      style sheets
  - lib/                       third-party font and libraries
  - partials/                  HTML templates, among which:
    - game-main.html           in-game main views
    - game-event.html          game history notices
  - index.inmem.html           test without a database connection
  - index.nocache.deploy.html  used in Chrome app
- lib/                         code shared between server and clients
  - game.js                    game objects and functions
  - proceed.js                 game logic

- visuals/                     non-redistributable visuals used in the game
                             
- config/                      configuration files, symlink one to config.js
- manifest.json                Chrome Web App settings
                             
- design/                      CouchDB design documents with map/reduce queries etc.
  - general.js                 used in multiple places
  - server.js                  only used by e.g. gamemaster
  - user.js                    only used by clients
                             
- bots/
  - bouncer.js                 handles user presence and data transfer
  - collector.*                collects money from Google for upgrading accounts
  - gamemaster.js              creates open games and proceeds them
  - hedwig.js                  delivers messages to users
  - host.js                    creates new user accounts
                             
- chrome/                      Chrome packaged app
- ios/                         iOS app
 
- tools/                       tools for development
  - actions.js                 create an overview of players who need to do something
  - less.sh                    compile style sheets for iOS
  - push.sh                    push to db, usage: server=name:passwd@server tools/push.sh
  - random.js                  take all open actions and perform them randomly
  - release.sh                 build Chrome app, usage: v=2.0.0 tools/release.sh
  - replicate_from_users.js    used in case bouncer doesn’t work properly

- node_modules/                imported libraries for the server
                             
- README.md                    this file

Third-party material distributed with app

lunacy's People

Contributors

sander avatar gesellix avatar

Watchers

 avatar James Cloos avatar  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.