class Legs

Private Instance Methods

draw() click to toggle source
Calls superclass method Limbs#draw
# File lib/compose/legs.rb, line 8
def draw
  super

  @limbs_num.times do |i|
    @limbs << Leg.new(@params_methods[i], hx(i), @body.body_right_top_y + Config::BODY_LENGTH)
  end
end
draw_parameters() click to toggle source
Calls superclass method Limbs#draw_parameters
# File lib/compose/legs.rb, line 16
def draw_parameters
  return if super
  @legs_step = (((@body.body_right_x - @body.body_left_x) * 0.9) / @limbs_num).round
end
hx(i) click to toggle source
# File lib/compose/legs.rb, line 21
def hx(i)
  body_margin = (@body.body_right_x - @body.body_left_x) * 0.1
  (@body.body_left_x + i * @legs_step + body_margin).round
end