Extracted Crosshair and Demo from Game

This commit is contained in:
2019-09-27 22:46:32 -05:00
parent 4af7f21a51
commit e038dcbe24
4 changed files with 136 additions and 82 deletions

16
lib/crosshair.rb Normal file
View File

@@ -0,0 +1,16 @@
class IMICFPS
class Crosshair
include CommonMethods
def initialize(color: Gosu::Color.rgb(255,127,0), size: 10, thickness: 3)
@color = color
@size = size
@thickness = thickness
end
def draw
draw_rect(window.width/2-@size, (window.height/2-@size)-@thickness/2, @size*2, @thickness, @color, 0, :default)
draw_rect((window.width/2)-@thickness/2, window.height/2-(@size*2), @thickness, @size*2, @color, 0, :default)
end
end
end