Refactor event bus to use non-retrievable events;

update collision handling and add new inventory initialization;
add torch lighting in fog shader;
This commit is contained in:
2026-03-28 11:38:20 +00:00
parent 15c457e7a6
commit bf93aecad1
14 changed files with 150 additions and 60 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ class EnemyAI
player_tile = [(player_x - 90) / 120, (player_y - 90) / 120].map(&:round)
enemy_tile = [(@enemy.x - 90) / 120, (@enemy.y - 90) / 120].map(&:round)
return if $bus.get(:collides?, @enemy.rect)&.include?(:character)
return if $bus.get_all(:collides?, @enemy.rect)&.include?(:character)
object_in_tile = $bus.get(:object_at, enemy_tile[0], enemy_tile[1])
@@ -134,7 +134,7 @@ class EnemyAI
@enemy.x += dx
@enemy.y += dy
if $bus.get(:collides?, @enemy.rect)&.include?(:character)
if $bus.get_all(:collides?, @enemy.rect)&.include?(:character)
# Attack player
end
end