222b28d196
- Added new image assets for game over screens: `game_over_dead_bg.png`, `game_over_victory_bg.png`, and their respective Aseprite files. - Introduced a new `Minimap` class to manage torch placement and rendering on the minimap. - Implemented methods for adding and removing torches, updating the grid area, and drawing the minimap based on the current state of the game. - Enhanced the minimap display with color coding for walls, empty spaces, and torches.
18 lines
314 B
Ruby
18 lines
314 B
Ruby
require_relative "base"
|
|
|
|
class Torch < Prop
|
|
setup_sprites("assets/images/torch.png", 4)
|
|
|
|
def resources
|
|
{ wood: rand(0..8) }
|
|
end
|
|
|
|
def update(dt)
|
|
dead = super(dt)
|
|
if dead
|
|
$bus.emit(:torch_removed, @x, @y)
|
|
pp "Emitted torch_removed for torch at #{@x}, #{@y}"
|
|
end
|
|
dead
|
|
end
|
|
end |