Refactor game state and HUD:

- Removed the State class as it was no longer needed.
- Updated the MazeData class to improve output formatting.
- Added new assets for HUD background and foreground.
- Implemented Inventory class to manage crafting and item selection.
- Created HUDLayer class to handle drawing the HUD and inventory interactions.
This commit is contained in:
2026-03-28 20:46:32 +00:00
parent 045200bf9f
commit f54679de61
14 changed files with 197 additions and 60 deletions
+4 -3
View File
@@ -1,6 +1,5 @@
require_relative 'state'
require_relative 'maze'
require_relative 'hud'
require_relative 'hud/layer'
require_relative 'props/handler'
require_relative 'enemy/handler'
require_relative 'character'
@@ -19,7 +18,7 @@ class Game < Scene
@enemies = EnemyHandler.new
@props = PropsHandler.new
@hud = HUD.new
@hud = HUDLayer.new
@camera = [0, 0]
@@ -152,5 +151,7 @@ class Game < Scene
def button_down(id, pos)
return $bus.emit(:change_scene, Menu.new) if id == Gosu::KB_ESCAPE
@hud.button_down(id, pos)
end
end