Refactor debug checks to use event bus settings for consistency across game components.

This commit is contained in:
2026-03-28 23:24:09 +00:00
parent 1fbd12e6f6
commit 3dbeadf976
9 changed files with 30 additions and 13 deletions
+18 -1
View File
@@ -3,4 +3,21 @@
SCREEN_SIZE = [720, 480].freeze
N, S, W, E = 1, 2, 4, 8
DEBUG = ARGV.include?("--debug")
# Config module to hold global settings that can be toggled in the settings scene, and accessed anywhere else in the code via the event bus
module Config
@config = {
debug: ARGV.include?("--debug"),
fog: true,
torches_lightup: false
}
$bus.on(:settings) do |k|
next @config[k]
end
module_function
def toggle(key)
@config[key] = !@config[key]
end
end