Giter VIP home page Giter VIP logo

black-market-bettors's Introduction

Black Market Brawlers : Riot API Challenge 2.0 entry

Category: Black Market Brawlers

Introduction

Black Market Bettors is a small game that will challenge your analysis capabilities :

  • The server is permanently running replays-like of black market brawlers games. Your aim is to guess which team will win : When you connect to the server, you will be able to guess which team will win as soon as a game is running
  • Throughout the game, you will see the evolution of gold/objectives/players stuffs/brawlers/... per team. If you think you chose the wrong team, change it ! Your final score will be calculated depending on the time spent with your bet placed on the right team.
  • When the game is over, you will see a screen displaying the winning team as well as your final score, which is : time spent on the winning team / game duration * 1000 (x1000 a score is always prettier)
  • Wait 10 seconds, and another game will be loaded. Have fun !

Demo

Here you go :)

How it works

  • The first time a client connects to the server, a game Singleton is initialized. For every new connection, a websocket will be opened between server and client
  • The singleton will first chose a random game, then get its timeline using the API. Please not that every piece of data except for images are stored in databased and reused instead of calling API again.
  • Once the game data is ready, the replay will start, sending sockets for every event to every client
  • When client bets on a team, it will start a timer, which will end either when the client changes team, or when game finishes.
  • At the end of the game, score of each client is computed and sent to the corresponding client.
  • Server will then sleep for ten seconds before reinitializing singleton.

Setting it up

Prerequisites

Postgresql (tested with 9.3.9)
Ruby 2.1.2
Rails 4.1.6

Configuration and launch

  • Rename the file config/riot_api.yml.sample to config/riot_api.yml and place your api_key in it
  • You can set the game speed in config/initializers/game.rb (default: 10, which means game will last ten times shorter than it actually did)
  • Build a valid database.yml. file, which you will place in config/ folder as well
  • bundle install
  • rake db:create
  • rake db:migrate
  • rails s

Notes

  • It might take a while to load games the first few times you launch the server, because you will have to request api for every single static data. Don't worry, it will get better.
  • There is a little problem with item sets at the moment. Don't be surprised if you happen to see multiple times the same tier 3 item on a player, it's just a bug feature

Legal

  • "black market bettors" isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.

black-market-bettors's People

Contributors

simonboeuf avatar

Watchers

 avatar  avatar  avatar

Forkers

ifeiii

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.