Added HUD widgets, make Boot and Close use button_up instead of button_down

This commit is contained in:
2020-05-04 08:57:58 -05:00
parent 1629cf4605
commit 85dd90b2f4
9 changed files with 164 additions and 2 deletions

23
lib/hud.rb Normal file
View File

@@ -0,0 +1,23 @@
class IMICFPS
class HUD
def initialize(player)
@ammo = AmmoWidget.new({ player: player })
@radar = RadarWidget.new({ player: player })
@health = HealthWidget.new({ player: player })
@hud_elements = [
@ammo,
@radar,
@health,
]
end
def draw
@hud_elements.each(&:draw)
end
def update
@hud_elements.each(&:update)
end
end
end