Giter Site home page Giter Site logo

lunacy's Introduction

Lunacy

Lunacy is a werewolves game for Chrome and iOS. It ran on playlunacy.com (not owned by me anymore).

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

Screenshots

<img alt="Night" src="https://raw.githubusercontent.com/sander/lunacy/gh-pages/images/screenshots/night.png" width="300" height"412"> <img alt="Chat" src="https://raw.githubusercontent.com/sander/lunacy/gh-pages/images/screenshots/chat.png" width="300" height"412"> <img alt="Lynchmob" src="https://raw.githubusercontent.com/sander/lunacy/gh-pages/images/screenshots/hang.png" width="300" height"412"> <img alt="Dashboard" src="https://raw.githubusercontent.com/sander/lunacy/gh-pages/images/screenshots/dashboard.png" width="300" height"412">

Artwork

The artwork used in Lunacy is not available under an open source or free software license. You can mail the author for a zipfile that you can then extract 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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lunacy's Issues

Improve loading experience

Provide the static screenshot to iOS, let it flow into a dynamic "loading" display.

Also display loading screen during initial replication, better than empty screen + throbbler.

Implement Thief

When dealing cards, one or a few extra are added. The thief may choose to select one of those cards after dealing.

Implement Cupid / the witch

This will not act as the regular Cupid: lovers won’t get any special winning powers.

Artwork for this role is ready.

Implement hotkeys

J/K to switch between games, H/L to switch between player votes, etc.

Implement miller and werefox

Miller = civilian with 50% chance to be seen as a werewolf by the seer
Werefox = vice versa

Artwork for both is ready.

Disable payments on iOS

Too complex for now. Alternatively we may want to just sell the app so that every iPhone user gets a full account.

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.