CodenjoyConnection
Gem handling ws connection and simple communication for numerous games in Codenjoy.
Installation
Add this line to your application's Gemfile:
gem 'codenjoy_connection'
And then execute:
$ bundle
Or install it yourself as:
$ gem install codenjoy_connection
Usage
require 'codenjoy_connection'
class Player
def initialize
# initialization of your user
end
def process_data(data)
# logic for processing data
end
def make_step
# logic for making step
end
end
player = Player.new
opts = {:username => 'anatoli', :host=> 'localhost', :port => '8080', :game_url => 'codenjoy-contest/ws?'}
CodenjoyConnection.play(player,opts)
Contributing
- Fork it ( https://github.com/anatoliliotych/codenjoy_connection/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request