Giter Site home page Giter Site logo

cryptofrye / gamblor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stephenmcd/gamblor

0.0 0.0 0.0 645 KB

An online casino app built for Django Dash 2012

Home Page: http://gamblor.jupo.org

License: BSD 2-Clause "Simplified" License

JavaScript 52.20% Python 47.80%

gamblor's Introduction

Created by Stephen McDonald

Introduction

Gamblor is a real-time casino app built for the 2012 Django Dash.

The idea was to provide a plugin system for games that can be played collaboratively in real-time using WebSockets, and to that end Gamblor was successful.

Check out the deployed version at http://gamblor.jupo.org.

Features

Here are some of the highlights that were implemented over the 48 hours of the Dash:

  • Simple plugin system for adding games with their own turn arguments, template, JavaScript and CSS files.
  • Initial games implemented are simple versions of Roulette and Craps.
  • Real-time avatars, controlled by arrow keys - walk around the game room and bash into your friends.
  • Authentication by Twitter or Facebook - profile photo is then used as the head of your avatar.
  • Chat system - talk to other avatars, messages are displayed above each avatar in real-time.
  • Gambling! Each user starts with $5000 and can bet against each game, simply drag chips onto a game to bet.
  • Interface is almost entirely CSS - chips use 3D transforms and dashed borders.

Game Engine

Games plug straight into Gamblor and consist of a handful of interfaces, the primary one being the core.game.Game base class:

  • Game.Form - defines the form class for the game, allowing arguments to be passed into each turn.
  • Game.bet - handles each person betting, and any args provided by the game's form.
  • Game.turn - implements the rules for a turn of the game.
  • Game.outcome - called at the end of each turn for each player, with their betting args passed in, and returns a value to multiply their bet by, which would be zero for a loss.

Other interfaces for each game are:

  • templates/games/<game-name>.html - template that renders the game visibly.
  • static/css/games/<game-name>.css - stylesheet for the game.
  • static/js/games/<game-name>.cjs - any JavaScript for the game, that can implement custom game effects, as well as betting handlers for the game.

TODO

As a one-man team for the first time in three years, this year was particularly gruelling! Here's a list of things I wanted to do, but fell short of time:

  • Show chips dropped onto games.
  • Add collision detection between avatars.
  • Show actual amounts won and loss to all users.
  • Show players who are in a particular game.
  • Implement all the rules for Roulette and Craps.
  • Let users drag chips onto each other to share money.
  • Provide ways of getting more money (share on Twitter, random handouts).
  • Sound effects!
  • Walking animations for avatars.
  • Animated dice for Craps.

gamblor's People

Contributors

stephenmcd 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.