examples/rmagick_integration.rb
# Magic numbers considered harmful! This is the height of the
# player as used for collision detection.
Magic numbers considered harmful. This is the height of the
player as used for collision detection.
Magic numbers considered harmful . This is the height of the player as used for collision detection .
def draw
    if dead
      @@images[0].draw_rot(x, y, 0, 290 * @dir, 0.5, 0.65, @dir * 0.5, 0.5, @color)
      @@images[2].draw_rot(x, y, 0, 160 * @dir, 0.95, 0.5, 0.5, @dir * 0.5, @color)
    else
      if @show_walk_anim
        frame = Gosu.milliseconds / 200 % 2
      else
        frame = 0
      end
      @@images[frame].draw(x - 10 * @dir, y - 20, 0, @dir * 0.5, 0.5, @color)
      angle = @angle
      angle = 180 - angle if @dir == -1
      @@images[2].draw_rot(x, y - 5, 0, angle, 1, 0.5, 0.5, @dir * 0.5, @color)
    end
  end
def draw if dead @@images [ 0 ] . draw_rot ( x , y , 0 , 290 * @dir , 0.5 , 0.65 , @dir * 0.5 , 0.5 , @color ) @@images [ 2 ] . draw_rot ( x , y , 0 , 160 * @dir , 0.95 , 0.5 , 0.5 , @dir * 0.5 , @color ) else if @show_walk_anim frame = Gosu . milliseconds / 200 % 2 else frame = 0 end @@images [ frame ] . draw ( x - 10 * @dir , y - 20 , 0 , @dir * 0.5 , 0.5 , @color ) angle = @angle angle = 180 - angle if @dir == - 1 @@images [ 2 ] . draw_rot ( x , y - 5 , 0 , angle , 1 , 0.5 , 0.5 , @dir * 0.5 , @color ) end end
Magic numbers considered harmful!
Magic numbers considered harmful!
# Poor, broken soldier. # Was moved last frame? # Yes: Display walking animation. # No: Stand around (boring). # Draw feet, then chest.