@@ -1,25 +1,11 @@
class Rectangle
class Rectangle < Polygon
include Constants

attr_accessor :x, :y, :width, :height, :color
def initialize(x, y, width, height, color = RED)
@x = x
@y = y
@width = width
@height = height
@color = color

def initialize(x, y, width, height)
@vertex = []
@vertex << { :x => x + width/2, :y => y + height/2}
@vertex << { :x => x - width/2, :y => y + height/2}
@vertex << { :x => x - width/2, :y => y - height/2}
@vertex << { :x => x + width/2, :y => y - height/2}
end

def draw()
Utils.draw_rect(self)
end

def left() @x - @width/2 end
def right() @x + @width/2 end
def top() @y - @height/2 end
def bottom() @y + @height/2 end
def left=(left) @x = left + @width/2 end
def right=(right) @x = right - @width/2 end
def top=(top) @y = top + @height/2 end
def bottom=(bottom) @y = bottom - @height/2 end
end
@@ -0,0 +1,14 @@
class Segment
include Constants

attr_accessor :a, :b, :c
def initialize(x1, y1, x2, y2, c = RED)
@a = { :x => x1, :y => y1 }
@b = { :x => x2, :y => y2 }
@c = c
end

def draw
Gosu::draw_line(@a[:x], @a[:y], c, @b[:x], @b[:y], c, 100) if $DEBUG_MODE
end
end
@@ -0,0 +1,3 @@
module Shape
#Just an identifier
end
@@ -48,6 +48,6 @@ def direct_to(angle_t, norm_t)

#Draw Functions
def draw(center)
Gosu.draw_line()
#Gosu.draw_line()
end
end
@@ -21,9 +21,7 @@ def update()
@released_keys.clear
if $DEBUG_MODE && Thread.list.size == 1
Thread.new do
#puts "Thread Started"
@log.log()
#puts "Thread Finished"
end.run
end
end