Sha256: 948ff3774d2897e07985c08af9511061d7d4e944c9bc818cc45c041c0c6dae4e

Contents?: true

Size: 390 Bytes

Versions: 2

Compression:

Stored size: 390 Bytes

Contents

module Gosu
  PathNode = Struct.new(:x, :y)

  def self.draw_path(nodes, color = Gosu::Color::WHITE, z = 0, mode = :default)
    last_node = nodes.first

    nodes[1..nodes.size - 1].each do |current_node|
      Gosu.draw_line(
        last_node.x, last_node.y, color,
        current_node.x, current_node.y, color,
        z, mode
      )

      last_node = current_node
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gosu_more_drawables-0.3.1 lib/gosu_more_drawables/draw_path.rb
gosu_more_drawables-0.3.0 lib/gosu_more_drawables/draw_path.rb