Compare commits
4 Commits
feature/co
...
claude-ref
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7deeffa8d6 | ||
| 272a54ea87 | |||
| 14b14ffc0c | |||
| 7e87a78a15 |
11
Makefile
11
Makefile
@@ -58,8 +58,8 @@ export: build
|
||||
@ls -lh $(PROJECT)-$(VERSION).* $(PROJECT).tic $(PROJECT).html.zip 2>/dev/null || true
|
||||
|
||||
watch:
|
||||
make build
|
||||
fswatch -o $(SRC_DIR) $(ORDER) assets | while read; do make build; done
|
||||
$(MAKE) build
|
||||
fswatch -o $(SRC_DIR) $(ORDER) assets | while read; do $(MAKE) build; done
|
||||
|
||||
import_assets: $(OUTPUT)
|
||||
@TIC_CMD="load $(OUTPUT) &"; \
|
||||
@@ -221,10 +221,3 @@ docs: build
|
||||
|
||||
.PHONY: all build export watch import_assets export_assets clean lint ci-version ci-export ci-upload ci-update install_precommit_hook docs
|
||||
|
||||
#-- <WAVES>
|
||||
#-- 000:224578acdeeeeddcba95434567653100
|
||||
#-- </WAVES>
|
||||
#
|
||||
#-- <SFX>
|
||||
#-- 000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000
|
||||
#-- </SFX>
|
||||
|
||||
@@ -3,7 +3,6 @@ init/init.module.lua
|
||||
init/init.config.lua
|
||||
init/init.minigame.lua
|
||||
init/init.meter.lua
|
||||
init/init.window.lua
|
||||
init/init.context.lua
|
||||
system/system.util.lua
|
||||
system/system.print.lua
|
||||
@@ -34,6 +33,7 @@ screen/screen.walking_to_office.lua
|
||||
screen/screen.office.lua
|
||||
screen/screen.walking_to_home.lua
|
||||
window/window.manager.lua
|
||||
window/window.register.lua
|
||||
window/window.splash.lua
|
||||
window/window.intro.lua
|
||||
window/window.menu.lua
|
||||
|
||||
@@ -11,6 +11,7 @@ function Audio.music_play_room_street_1() end
|
||||
--- Plays room street 2 music.
|
||||
function Audio.music_play_room_street_2() end
|
||||
--- Plays room music.
|
||||
-- TODO: function name is incomplete, determine the correct room identifier
|
||||
function Audio.music_play_room_() end
|
||||
--- Plays room work music.
|
||||
function Audio.music_play_room_work() end
|
||||
|
||||
@@ -27,13 +27,13 @@ end
|
||||
--- Gets a decision by ID.
|
||||
-- @param id string The ID of the decision.
|
||||
-- @return table The decision table or nil.
|
||||
function Decision.get(id)
|
||||
function Decision.get_by_id(id)
|
||||
return _decisions[id]
|
||||
end
|
||||
|
||||
--- Gets all registered decisions.
|
||||
-- @return table A table of all registered decisions.
|
||||
function Decision.get_all_registered()
|
||||
function Decision.get_all()
|
||||
return _decisions
|
||||
end
|
||||
|
||||
@@ -47,7 +47,7 @@ function Decision.get_for_screen(screen_data)
|
||||
|
||||
local screen_decisions = {}
|
||||
for _, decision_id in ipairs(screen_data.decisions) do
|
||||
local decision = Decision.get(decision_id)
|
||||
local decision = Decision.get_by_id(decision_id)
|
||||
if decision then
|
||||
table.insert(screen_decisions, decision)
|
||||
end
|
||||
|
||||
@@ -7,11 +7,11 @@ function Config.initial_data()
|
||||
height = 136
|
||||
},
|
||||
colors = {
|
||||
black = 0,
|
||||
black = 2,
|
||||
light_grey = 13,
|
||||
dark_grey = 14,
|
||||
red = 2,
|
||||
green = 6,
|
||||
red = 0,
|
||||
green = 7,
|
||||
blue = 9,
|
||||
white = 12,
|
||||
item = 12,
|
||||
|
||||
@@ -31,7 +31,8 @@ end
|
||||
function Context.reset()
|
||||
local initial_data = Context.initial_data()
|
||||
for k in pairs(Context) do
|
||||
if type(Context[k]) ~= "function" then Context[k] = nil
|
||||
if type(Context[k]) ~= "function" then
|
||||
Context[k] = nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -57,7 +58,7 @@ end
|
||||
--- Loads a saved game state.
|
||||
function Context.load_game()
|
||||
if mget(SAVE_GAME_MAGIC_VALUE_ADDRESS, SAVE_GAME_BANK) ~= SAVE_GAME_MAGIC_VALUE then
|
||||
Context.new_game()
|
||||
Context.new_game()
|
||||
return
|
||||
end
|
||||
Context.reset()
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
-- Manages minigame configurations and initial states.
|
||||
Minigame = {}
|
||||
|
||||
--- Applies parameters to defaults.
|
||||
-- @param defaults table The default configuration table.
|
||||
|
||||
@@ -2,7 +2,9 @@ local INPUT_KEY_UP = 0
|
||||
local INPUT_KEY_DOWN = 1
|
||||
local INPUT_KEY_LEFT = 2
|
||||
local INPUT_KEY_RIGHT = 3
|
||||
local INPUT_KEY_A = 4 local INPUT_KEY_B = 5 local INPUT_KEY_Y = 7
|
||||
local INPUT_KEY_A = 4
|
||||
local INPUT_KEY_B = 5
|
||||
local INPUT_KEY_Y = 7
|
||||
local INPUT_KEY_SPACE = 48
|
||||
local INPUT_KEY_BACKSPACE = 51
|
||||
local INPUT_KEY_ENTER = 50
|
||||
|
||||
@@ -123,10 +123,13 @@ function UI.draw_decision_selector(decisions, selected_decision_index)
|
||||
if #decisions > 0 then
|
||||
local selected_decision = decisions[selected_decision_index]
|
||||
local decision_label = selected_decision.label
|
||||
local text_width = #decision_label * 4 local text_y = bar_y + 4
|
||||
local text_x = (Config.screen.width - text_width) / 2
|
||||
Print.text("<", 2, text_y, Config.colors.green)
|
||||
Print.text(decision_label, text_x, text_y, Config.colors.item) Print.text(">", Config.screen.width - 6, text_y, Config.colors.green) end
|
||||
local text_width = #decision_label * 4
|
||||
local text_y = bar_y + 4
|
||||
local text_x = (Config.screen.width - text_width) / 2
|
||||
Print.text("<", 2, text_y, Config.colors.green)
|
||||
Print.text(decision_label, text_x, text_y, Config.colors.item)
|
||||
Print.text(">", Config.screen.width - 6, text_y, Config.colors.green)
|
||||
end
|
||||
end
|
||||
|
||||
--- Draws meters.
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
--- Utility functions.
|
||||
Util = {}
|
||||
|
||||
--- Safely wraps an index for an array.
|
||||
-- @param array table The array to index.
|
||||
@@ -15,16 +13,13 @@ function Util.go_to_screen_by_id(screen_id)
|
||||
local screen = Screen.get_by_id(screen_id)
|
||||
if screen then
|
||||
Context.game.current_screen = screen_id
|
||||
local all_decisions_for_screen = Decision.get_for_screen(screen)
|
||||
Context.game.decisions = Decision.filter_available(all_decisions_for_screen)
|
||||
Context.game.selected_decision_index = 1
|
||||
screen.init() -- Initialize the new screen
|
||||
screen.init()
|
||||
else
|
||||
PopupWindow.show({"Error: Screen '" .. screen_id .. "' not found!"})
|
||||
end
|
||||
end
|
||||
|
||||
-- Checks if a table contains a specific value.
|
||||
--- Checks if a table contains a specific value.
|
||||
-- @param t table The table to check.
|
||||
-- @param value any The value to look for.
|
||||
function Util.contains(t, value)
|
||||
|
||||
@@ -19,7 +19,7 @@ function AudioTestWindow.generate_menuitems(list_func, index_func)
|
||||
if current_func then
|
||||
current_func()
|
||||
else
|
||||
trace("Invalid Audio function: " .. list_func[index_menu])
|
||||
trace("Invalid Audio function: " .. list_func[index_func])
|
||||
end
|
||||
end
|
||||
},
|
||||
|
||||
@@ -6,13 +6,13 @@ ConfigurationWindow = {
|
||||
--- Initializes configuration window.
|
||||
function ConfigurationWindow.init()
|
||||
ConfigurationWindow.controls = {
|
||||
UI.create_decision_item(
|
||||
UI.create_action_item(
|
||||
"Save",
|
||||
function() Config.save() end
|
||||
),
|
||||
UI.create_decision_item(
|
||||
UI.create_action_item(
|
||||
"Restore Defaults",
|
||||
function() Config.restore_defaults() end
|
||||
function() Config.reset() end
|
||||
),
|
||||
}
|
||||
end
|
||||
@@ -21,7 +21,8 @@ end
|
||||
function ConfigurationWindow.draw()
|
||||
UI.draw_top_bar("Configuration")
|
||||
|
||||
local x_start = 10 local y_start = 40
|
||||
local x_start = 10
|
||||
local y_start = 40
|
||||
local x_value_right_align = Config.screen.width - 10
|
||||
local char_width = 4
|
||||
for i, control in ipairs(ConfigurationWindow.controls) do
|
||||
@@ -31,22 +32,23 @@ function ConfigurationWindow.draw()
|
||||
local value = control.get()
|
||||
local label_text = control.label
|
||||
local value_text = string.format(control.format, value)
|
||||
|
||||
local value_x = x_value_right_align - (#value_text * char_width)
|
||||
local value_x = x_value_right_align - (#value_text * char_width)
|
||||
|
||||
if i == ConfigurationWindow.selected_control then
|
||||
color = Config.colors.item
|
||||
Print.text("<", x_start -8, current_y, color)
|
||||
Print.text(label_text, x_start, current_y, color) Print.text(value_text, value_x, current_y, color)
|
||||
Print.text(">", x_value_right_align + 4, current_y, color) else
|
||||
Print.text("<", x_start - 8, current_y, color)
|
||||
Print.text(label_text, x_start, current_y, color)
|
||||
Print.text(value_text, value_x, current_y, color)
|
||||
Print.text(">", x_value_right_align + 4, current_y, color)
|
||||
else
|
||||
Print.text(label_text, x_start, current_y, color)
|
||||
Print.text(value_text, value_x, current_y, color)
|
||||
end
|
||||
elseif control.type == "decision_item" then
|
||||
elseif control.type == "action_item" then
|
||||
local label_text = control.label
|
||||
if i == ConfigurationWindow.selected_control then
|
||||
color = Config.colors.item
|
||||
Print.text("<", x_start -8, current_y, color)
|
||||
Print.text("<", x_start - 8, current_y, color)
|
||||
Print.text(label_text, x_start, current_y, color)
|
||||
Print.text(">", x_start + 8 + (#label_text * char_width) + 4, current_y, color)
|
||||
else
|
||||
@@ -80,14 +82,16 @@ function ConfigurationWindow.update()
|
||||
if control then
|
||||
if control.type == "numeric_stepper" then
|
||||
local current_value = control.get()
|
||||
if btnp(2) then local new_value = math.max(control.min, current_value - control.step)
|
||||
if Input.left() then
|
||||
local new_value = math.max(control.min, current_value - control.step)
|
||||
control.set(new_value)
|
||||
elseif btnp(3) then local new_value = math.min(control.max, current_value + control.step)
|
||||
elseif Input.right() then
|
||||
local new_value = math.min(control.max, current_value + control.step)
|
||||
control.set(new_value)
|
||||
end
|
||||
elseif control.type == "decision_item" then
|
||||
elseif control.type == "action_item" then
|
||||
if Input.menu_confirm() then
|
||||
control.decision()
|
||||
control.action()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ local _selected_decision_index = 1
|
||||
--- Draws the game window.
|
||||
function GameWindow.draw()
|
||||
local screen = Screen.get_by_id(Context.game.current_screen)
|
||||
Map.draw(screen.background)
|
||||
if screen.background then Map.draw(screen.background) end
|
||||
UI.draw_top_bar(screen.name)
|
||||
if #_available_decisions > 0 then
|
||||
UI.draw_decision_selector(_available_decisions, _selected_decision_index)
|
||||
@@ -15,7 +15,7 @@ end
|
||||
--- Updates the game window logic.
|
||||
function GameWindow.update()
|
||||
if Input.menu_back() then
|
||||
Context.current_window = "menu"
|
||||
Window.set_current("menu")
|
||||
MenuWindow.refresh_menu_items()
|
||||
return
|
||||
end
|
||||
@@ -23,7 +23,7 @@ function GameWindow.update()
|
||||
local screen = Screen.get_by_id(Context.game.current_screen)
|
||||
screen.update()
|
||||
|
||||
-- Handle situations (Context.game.current_situation is still present)
|
||||
-- Handle current situation updates
|
||||
if Context.game.current_situation then
|
||||
local current_situation_obj = Situation.get_by_id(Context.game.current_situation)
|
||||
if current_situation_obj and current_situation_obj.update then
|
||||
@@ -37,6 +37,10 @@ function GameWindow.update()
|
||||
|
||||
if #_available_decisions == 0 then return end
|
||||
|
||||
if _selected_decision_index > #_available_decisions then
|
||||
_selected_decision_index = 1
|
||||
end
|
||||
|
||||
local new_selected_decision_index = UI.update_decision_selector(
|
||||
_available_decisions,
|
||||
_selected_decision_index
|
||||
@@ -56,7 +60,7 @@ function GameWindow.update()
|
||||
end
|
||||
|
||||
--- Sets the active window.
|
||||
-- @param new_state number The ID of the new active window.
|
||||
-- @param new_state string The ID of the new active window.
|
||||
function GameWindow.set_state(new_state)
|
||||
Context.current_window = new_state
|
||||
Window.set_current(new_state)
|
||||
end
|
||||
|
||||
@@ -23,16 +23,16 @@ end
|
||||
function IntroWindow.update()
|
||||
IntroWindow.y = IntroWindow.y - IntroWindow.speed
|
||||
|
||||
local lines = 1
|
||||
local lines = 1
|
||||
for _ in string.gmatch(IntroWindow.text, "\n") do
|
||||
lines = lines + 1
|
||||
end
|
||||
|
||||
if IntroWindow.y < -lines * 8 then
|
||||
GameWindow.set_state("menu")
|
||||
if IntroWindow.y < -lines * 8 then
|
||||
Window.set_current("menu")
|
||||
end
|
||||
|
||||
if Input.menu_confirm() then
|
||||
GameWindow.set_state("menu")
|
||||
if Input.menu_confirm() then
|
||||
Window.set_current("menu")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -41,24 +41,3 @@ function Window.get_current_handler()
|
||||
return function() trace("Error: No handler for window: " .. tostring(Context.current_window)) end
|
||||
end
|
||||
end
|
||||
SplashWindow = {}
|
||||
IntroWindow = {}
|
||||
MenuWindow = {}
|
||||
GameWindow = {}
|
||||
PopupWindow = {}
|
||||
ConfigurationWindow = {}
|
||||
AudioTestWindow = {}
|
||||
MinigameButtonMashWindow = {}
|
||||
MinigameRhythmWindow = {}
|
||||
MinigameDDRWindow = {}
|
||||
-- Registration of all window modules
|
||||
Window.register("splash", SplashWindow)
|
||||
Window.register("intro", IntroWindow)
|
||||
Window.register("menu", MenuWindow)
|
||||
Window.register("game", GameWindow)
|
||||
Window.register("popup", PopupWindow)
|
||||
Window.register("configuration", ConfigurationWindow)
|
||||
Window.register("audiotest", AudioTestWindow)
|
||||
Window.register("minigame_button_mash", MinigameButtonMashWindow)
|
||||
Window.register("minigame_rhythm", MinigameRhythmWindow)
|
||||
Window.register("minigame_ddr", MinigameDDRWindow)
|
||||
|
||||
@@ -21,17 +21,20 @@ end
|
||||
|
||||
--- Starts a new game from the menu.
|
||||
function MenuWindow.new_game()
|
||||
Context.new_game() GameWindow.set_state("game")
|
||||
Context.new_game()
|
||||
GameWindow.set_state("game")
|
||||
end
|
||||
|
||||
--- Loads a game from the menu.
|
||||
function MenuWindow.load_game()
|
||||
Context.load_game() GameWindow.set_state("game")
|
||||
Context.load_game()
|
||||
GameWindow.set_state("game")
|
||||
end
|
||||
|
||||
--- Saves the current game from the menu.
|
||||
function MenuWindow.save_game()
|
||||
Context.save_game() end
|
||||
Context.save_game()
|
||||
end
|
||||
|
||||
--- Resumes the game from the menu.
|
||||
function MenuWindow.resume_game()
|
||||
|
||||
@@ -5,7 +5,7 @@ function MinigameDDRWindow.init(params)
|
||||
end
|
||||
|
||||
--- Starts the DDR minigame.
|
||||
-- @param return_window number The window ID to return to after the minigame.
|
||||
-- @param return_window string The window ID to return to after the minigame.
|
||||
-- @param[opt] song_key string The key of the song to play.
|
||||
-- @param[opt] params table Optional parameters for minigame configuration.
|
||||
function MinigameDDRWindow.start(return_window, song_key, params)
|
||||
@@ -25,7 +25,7 @@ function MinigameDDRWindow.start(return_window, song_key, params)
|
||||
Context.minigame_ddr.debug_status = "Random mode"
|
||||
end
|
||||
end
|
||||
Context.current_window = "minigame_ddr"
|
||||
Window.set_current("minigame_ddr")
|
||||
end
|
||||
|
||||
--- Spawns a random arrow.
|
||||
@@ -101,7 +101,7 @@ function MinigameDDRWindow.update()
|
||||
if mg.bar_fill >= mg.max_fill then
|
||||
Meter.on_minigame_complete()
|
||||
Meter.show()
|
||||
Context.current_window = mg.return_window
|
||||
Window.set_current(mg.return_window)
|
||||
return
|
||||
end
|
||||
mg.frame_counter = mg.frame_counter + 1
|
||||
@@ -109,7 +109,7 @@ function MinigameDDRWindow.update()
|
||||
if mg.frame_counter > mg.current_song.end_frame and #mg.arrows == 0 then
|
||||
Meter.on_minigame_complete()
|
||||
Meter.show()
|
||||
Context.current_window = mg.return_window
|
||||
Window.set_current(mg.return_window)
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -196,7 +196,7 @@ function MinigameDDRWindow.draw()
|
||||
print("DDR ERROR: Context not initialized", 10, 10, 12)
|
||||
print("Press Z to return", 10, 20, 12)
|
||||
if Input.select() then
|
||||
Context.current_window = "game"
|
||||
Window.set_current("game")
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
@@ -5,12 +5,12 @@ function MinigameButtonMashWindow.init(params)
|
||||
end
|
||||
|
||||
--- Starts the button mash minigame.
|
||||
-- @param return_window number The window ID to return to after the minigame.
|
||||
-- @param return_window string The window ID to return to after the minigame.
|
||||
-- @param[opt] params table Optional parameters for minigame configuration.
|
||||
function MinigameButtonMashWindow.start(return_window, params)
|
||||
MinigameButtonMashWindow.init(params)
|
||||
Context.minigame_button_mash.return_window = return_window or "game"
|
||||
Context.current_window = "minigame_button_mash"
|
||||
Window.set_current("minigame_button_mash")
|
||||
end
|
||||
|
||||
--- Updates button mash minigame logic.
|
||||
@@ -26,7 +26,7 @@ function MinigameButtonMashWindow.update()
|
||||
if mg.bar_fill >= mg.max_fill then
|
||||
Meter.on_minigame_complete()
|
||||
Meter.show()
|
||||
Context.current_window = mg.return_window
|
||||
Window.set_current(mg.return_window)
|
||||
return
|
||||
end
|
||||
local degradation = mg.base_degradation + (mg.bar_fill * mg.degradation_multiplier)
|
||||
|
||||
@@ -5,12 +5,12 @@ function MinigameRhythmWindow.init(params)
|
||||
end
|
||||
|
||||
--- Starts the rhythm minigame.
|
||||
-- @param return_window number The window ID to return to after the minigame.
|
||||
-- @param return_window string The window ID to return to after the minigame.
|
||||
-- @param[opt] params table Optional parameters for minigame configuration.
|
||||
function MinigameRhythmWindow.start(return_window, params)
|
||||
MinigameRhythmWindow.init(params)
|
||||
Context.minigame_rhythm.return_window = return_window or "game"
|
||||
Context.current_window = "minigame_rhythm"
|
||||
Window.set_current("minigame_rhythm")
|
||||
end
|
||||
|
||||
--- Updates rhythm minigame logic.
|
||||
@@ -48,7 +48,7 @@ function MinigameRhythmWindow.update()
|
||||
if mg.score >= mg.max_score then
|
||||
Meter.on_minigame_complete()
|
||||
Meter.show()
|
||||
Context.current_window = mg.return_window
|
||||
Window.set_current(mg.return_window)
|
||||
return
|
||||
end
|
||||
if mg.button_pressed_timer > 0 then
|
||||
|
||||
@@ -5,21 +5,27 @@ local POPUP_HEIGHT = 80
|
||||
local TEXT_MARGIN_X = POPUP_X + 10
|
||||
local TEXT_MARGIN_Y = POPUP_Y + 10
|
||||
local LINE_HEIGHT = 8
|
||||
|
||||
--- Displays a popup window.
|
||||
-- @param content_strings table A table of strings to display in the popup.
|
||||
function PopupWindow.show(content_strings)
|
||||
Context.popup.show = true
|
||||
Context.popup.content = content_strings or {} GameWindow.set_state("popup") end
|
||||
Context.popup.content = content_strings or {}
|
||||
GameWindow.set_state("popup")
|
||||
end
|
||||
|
||||
--- Hides the popup window.
|
||||
function PopupWindow.hide()
|
||||
Context.popup.show = false
|
||||
Context.popup.content = {} GameWindow.set_state("game") end
|
||||
Context.popup.content = {}
|
||||
GameWindow.set_state("game")
|
||||
end
|
||||
|
||||
--- Updates popup window logic.
|
||||
function PopupWindow.update()
|
||||
if Context.popup.show then
|
||||
if Input.menu_confirm() or Input.menu_back() then PopupWindow.hide()
|
||||
if Input.menu_confirm() or Input.menu_back() then
|
||||
PopupWindow.hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -36,6 +42,6 @@ function PopupWindow.draw()
|
||||
current_y = current_y + LINE_HEIGHT
|
||||
end
|
||||
|
||||
Print.text("[A] Close", TEXT_MARGIN_X, POPUP_Y + POPUP_HEIGHT - LINE_HEIGHT - 2, Config.colors.green)
|
||||
Print.text("[A] Close", TEXT_MARGIN_X, POPUP_Y + POPUP_HEIGHT - LINE_HEIGHT - 2, Config.colors.green)
|
||||
end
|
||||
end
|
||||
|
||||
29
inc/window/window.register.lua
Normal file
29
inc/window/window.register.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
SplashWindow = {}
|
||||
Window.register("splash", SplashWindow)
|
||||
|
||||
IntroWindow = {}
|
||||
Window.register("intro", IntroWindow)
|
||||
|
||||
MenuWindow = {}
|
||||
Window.register("menu", MenuWindow)
|
||||
|
||||
GameWindow = {}
|
||||
Window.register("game", GameWindow)
|
||||
|
||||
PopupWindow = {}
|
||||
Window.register("popup", PopupWindow)
|
||||
|
||||
ConfigurationWindow = {}
|
||||
Window.register("configuration", ConfigurationWindow)
|
||||
|
||||
AudioTestWindow = {}
|
||||
Window.register("audiotest", AudioTestWindow)
|
||||
|
||||
MinigameButtonMashWindow = {}
|
||||
Window.register("minigame_button_mash", MinigameButtonMashWindow)
|
||||
|
||||
MinigameRhythmWindow = {}
|
||||
Window.register("minigame_rhythm", MinigameRhythmWindow)
|
||||
|
||||
MinigameDDRWindow = {}
|
||||
Window.register("minigame_ddr", MinigameDDRWindow)
|
||||
@@ -1,16 +1,14 @@
|
||||
--- Draws the splash window.
|
||||
function SplashWindow.draw()
|
||||
local txt = "Definitely not an Impostor"
|
||||
local w = #txt * 6
|
||||
local x = (240 - w) / 2
|
||||
local y = (136 - 6) / 2
|
||||
print(txt, x, y, 12)
|
||||
local y = (Config.screen.height - 6) / 2
|
||||
Print.text_center(txt, Config.screen.width / 2, y, Config.colors.white)
|
||||
end
|
||||
|
||||
--- Updates the splash window logic.
|
||||
function SplashWindow.update()
|
||||
Context.splash_timer = Context.splash_timer - 1
|
||||
if Context.splash_timer <= 0 or Input.menu_confirm() then
|
||||
GameWindow.set_state("intro")
|
||||
Window.set_current("intro")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user