mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Added HUD widgets, make Boot and Close use button_up instead of button_down
This commit is contained in:
23
lib/hud.rb
Normal file
23
lib/hud.rb
Normal 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
|
||||
Reference in New Issue
Block a user