class RubyFighter::Player::Tileset
Public Class Methods
new(window, name)
click to toggle source
# File lib/ruby_fighter/player.rb, line 82 def initialize(window, name) self[:idle] = RubyFighter::Animation.new(window, "#{name}/idle") self[:walking] = RubyFighter::Animation.new(window, "#{name}/walking") self[:blocking] = RubyFighter::Animation.new(window, "#{name}/blocking") self[:punch] = RubyFighter::Animation.new(window, "#{name}/punch") self[:kick] = RubyFighter::Animation.new(window, "#{name}/kick") idle! end
Public Instance Methods
blocking!()
click to toggle source
# File lib/ruby_fighter/player.rb, line 100 def blocking! @current_animation = self[:blocking] end
draw(*args)
click to toggle source
# File lib/ruby_fighter/player.rb, line 118 def draw(*args) @current_animation.draw *args end
idle!()
click to toggle source
# File lib/ruby_fighter/player.rb, line 92 def idle! @current_animation = self[:idle] end
kick!(&callback)
click to toggle source
# File lib/ruby_fighter/player.rb, line 109 def kick!(&callback) @current_animation = self[:kick] @current_animation.play_once &callback end
punch!(&callback)
click to toggle source
# File lib/ruby_fighter/player.rb, line 104 def punch!(&callback) @current_animation = self[:punch] @current_animation.play_once &callback end
walking!()
click to toggle source
# File lib/ruby_fighter/player.rb, line 96 def walking! @current_animation = self[:walking] end
width()
click to toggle source
# File lib/ruby_fighter/player.rb, line 114 def width @current_animation.width end