Sha256: b495ca63535fe402ed6cf9435813ebcb3e58f6b898b470612b7f7813141486e1
Contents?: true
Size: 615 Bytes
Versions: 7
Compression:
Stored size: 615 Bytes
Contents
module CP module Shape class Poly attr_reader :verts, :offset def initialize_with_verts body, verts, offset @verts, @offset = verts, offset initialize_without_verts body, verts, offset end alias_method_chain :initialize, :verts def debug window, thing colors = [Gosu::Color::RED]*verts.size points = verts.map{ |vert| vert = vert.rotate(body.a.radians_to_vec2); vert += body.p; [vert.x, vert.y] }.zip(colors).flatten points << 0 << :default window.draw_quad *points end end end end
Version data entries
7 entries across 7 versions & 1 rubygems