added initial pong bots
This commit is contained in:
parent
865c963ad6
commit
9c8d04114c
3 changed files with 127 additions and 0 deletions
29
games/Pong-bots/pong-bot.rb
Normal file
29
games/Pong-bots/pong-bot.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env ruby -wKU
|
||||
|
||||
require 'ggs-network.rb'
|
||||
require 'ggs-delegate.rb'
|
||||
|
||||
class PongBot
|
||||
include GGSDelegate
|
||||
|
||||
def initialize
|
||||
@ggs_network = GGSNetwork.new(self)
|
||||
end
|
||||
|
||||
def ggsNetworkReady(ggs_network, ready)
|
||||
@ggs_network.sendCommand("ready")
|
||||
end
|
||||
|
||||
def ggsNetworkDefined(ggs_network, defined)
|
||||
# do nothing
|
||||
end
|
||||
|
||||
def ggsNetworkReceivedCommandWithArgs(ggs_network, command, args)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if __FILE__ == $0
|
||||
PongBot.new
|
||||
end
|
Reference in a new issue