diff --git a/assets/images/chest.aseprite b/assets/images/chest.aseprite new file mode 100644 index 0000000..471db92 Binary files /dev/null and b/assets/images/chest.aseprite differ diff --git a/assets/images/chest.png b/assets/images/chest.png new file mode 100644 index 0000000..72e75e4 Binary files /dev/null and b/assets/images/chest.png differ diff --git a/assets/images/inventory.aseprite b/assets/images/inventory.aseprite index 7f060a2..29efdf3 100644 Binary files a/assets/images/inventory.aseprite and b/assets/images/inventory.aseprite differ diff --git a/game/maze.rb b/game/maze.rb index 20f539f..51ea6f4 100644 --- a/game/maze.rb +++ b/game/maze.rb @@ -6,6 +6,8 @@ class Maze @spritesheet = Gosu::Image.load_tiles("assets/images/walls.png", 20, 40, retro: true) puts @spritesheet.size + $bus.on(:maze_size) { [80, 80] } + $bus.on(:maze_solve) do |x1, y1, x2, y2| next @maze.solve(x1, y1, x2, y2) end diff --git a/game/placeables/base.rb b/game/placeables/base.rb index f28174e..2f404ca 100644 --- a/game/placeables/base.rb +++ b/game/placeables/base.rb @@ -87,11 +87,11 @@ class ObjectHandler def initialize start_room_coords = $bus.get(:start_room_coords) - @objects = [ - Torch.new(start_room_coords[0] / 2 - 1, start_room_coords[1] / 2 - 1), - Torch.new(start_room_coords[0] / 2 + 3, start_room_coords[1] / 2), - Torch.new(start_room_coords[0] / 2, start_room_coords[1] / 2 - 1), - ] + @objects = [] + end + + def spawn_chests! + world_size = $bus.get(:maze_size) || [0, 0] end def add(object)