Compare commits

..

1 Commits

Author SHA1 Message Date
24757e8cca end window WIP
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline failed
2026-03-12 00:38:28 +01:00
6 changed files with 2 additions and 65 deletions

View File

@@ -11,7 +11,6 @@ logic/logic.day.lua
logic/logic.timer.lua
logic/logic.trigger.lua
logic/logic.minigame.lua
logic/logic.glitch.lua
system/system.ui.lua
audio/audio.manager.lua
audio/audio.songs.lua

View File

@@ -2,7 +2,6 @@ Decision.register({
id = "go_to_office",
label = "Go to Office",
handle = function()
Glitch.show()
Util.go_to_screen_by_id("office")
end,
})

View File

@@ -42,11 +42,6 @@ function Context.initial_data()
current_situation = nil,
},
day_count = 1,
glitch = {
enabled = false,
state = "active",
timer = 0,
},
_end = {
state = "choice",
selection = 1,

View File

@@ -1,57 +0,0 @@
Glitch = {}
--- Shows the glitch effect.
--- @within Glitch
function Glitch.show()
if Context and Context.glitch then
Context.glitch.enabled = true
end
end
--- Hides the glitch effect.
--- @within Glitch
function Glitch.hide()
if Context and Context.glitch then
Context.glitch.enabled = false
end
end
--- Draws the glitch effect if active.
--- @within Glitch
function Glitch.draw()
if not Context or not Context.glitch or not Context.glitch.enabled then return end
-- Update state timer
Context.glitch.timer = Context.glitch.timer - 1
if Context.glitch.timer <= 0 then
if Context.glitch.state == "active" then
Context.glitch.state = "waiting"
Context.glitch.timer = math.random(20, 60) -- Time to stay fixed
else
Context.glitch.state = "active"
Context.glitch.timer = math.random(40, 100) -- Time to stay glitchy
end
end
-- Draw stripes only when active
if Context.glitch.state == "active" then
for i = 1, 15 do
local rx = math.random(0, Config.screen.width - 1)
local ry = math.random(0, Config.screen.height - 1)
-- Sample color at the random point
local color = pix(rx, ry)
-- Determine random length for the stripe (2-40)
local length = math.random(2, 40)
-- Draw the vertical stripe
for sy = 0, length - 1 do
local dy = ry + sy
if dy < Config.screen.height then
pix(rx, dy, color)
end
end
end
end
end

View File

@@ -27,6 +27,5 @@ function TIC()
if Context.game_in_progress then
Meter.draw()
Timer.draw()
Glitch.draw()
end
end

View File

@@ -1,3 +1,5 @@
EndWindow = {}
--- Draws the end screen window.
--- @within EndWindow
function EndWindow.draw()