class RubyFighter::Game
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/ruby_fighter/game.rb, line 4 def initialize super(768, 480, false) self.caption = "Ruby Fighter" @backdrop = Backdrop.new(self, "background-1.jpg") @player1 = Player.new(self, "ryu", false) @player2 = Player.new(self, "chun-li", true) @controls1 = Controls.new(self, @player1, 1) @controls2 = Controls.new(self, @player2, 2) end
Public Instance Methods
draw()
click to toggle source
# File lib/ruby_fighter/game.rb, line 17 def draw @backdrop.draw @player1.draw @player2.draw end
update()
click to toggle source
# File lib/ruby_fighter/game.rb, line 24 def update @controls1.update 0, @player2.left @controls2.update @player1.right, width end