Compare commits
1 Commits
bugfix/suc
...
7c33c3d587
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c33c3d587 |
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
globals = {
|
globals = {
|
||||||
"Focus",
|
"Focus",
|
||||||
|
"Day",
|
||||||
"Util",
|
"Util",
|
||||||
"Decision",
|
"Decision",
|
||||||
"Situation",
|
"Situation",
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ system/system.util.lua
|
|||||||
system/system.print.lua
|
system/system.print.lua
|
||||||
system/system.input.lua
|
system/system.input.lua
|
||||||
system/system.focus.lua
|
system/system.focus.lua
|
||||||
|
system/system.day.lua
|
||||||
system/system.ui.lua
|
system/system.ui.lua
|
||||||
audio/audio.manager.lua
|
audio/audio.manager.lua
|
||||||
audio/audio.songs.lua
|
audio/audio.songs.lua
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ function Audio.music_play_room_street_1() end
|
|||||||
--- @within Audio
|
--- @within Audio
|
||||||
function Audio.music_play_room_street_2() end
|
function Audio.music_play_room_street_2() end
|
||||||
--- Plays room music.
|
--- Plays room music.
|
||||||
-- TODO: function name is incomplete, determine the correct room identifier
|
|
||||||
--- @within Audio
|
--- @within Audio
|
||||||
function Audio.music_play_room_() end
|
function Audio.music_play_room_() end
|
||||||
--- Plays room work music.
|
--- Plays room work music.
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ function Context.initial_data()
|
|||||||
game = {
|
game = {
|
||||||
current_screen = "home",
|
current_screen = "home",
|
||||||
current_situation = nil,
|
current_situation = nil,
|
||||||
}
|
},
|
||||||
|
day_count = 1,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ function Meter.update()
|
|||||||
end
|
end
|
||||||
m.timer_progress = m.timer_progress + (1 / meter_timer_duration)
|
m.timer_progress = m.timer_progress + (1 / meter_timer_duration)
|
||||||
if m.timer_progress >= 1 then
|
if m.timer_progress >= 1 then
|
||||||
|
Day.increase()
|
||||||
m.timer_progress = m.timer_progress - 1
|
m.timer_progress = m.timer_progress - 1
|
||||||
m.ism = math.max(0, m.ism - meter_timer_decay_per_revolution)
|
m.ism = math.max(0, m.ism - meter_timer_decay_per_revolution)
|
||||||
m.wpm = math.max(0, m.wpm - meter_timer_decay_per_revolution)
|
m.wpm = math.max(0, m.wpm - meter_timer_decay_per_revolution)
|
||||||
|
|||||||
@@ -12,3 +12,4 @@ Input = {}
|
|||||||
Sprite = {}
|
Sprite = {}
|
||||||
Audio = {}
|
Audio = {}
|
||||||
Focus = {}
|
Focus = {}
|
||||||
|
Day = {}
|
||||||
@@ -30,8 +30,7 @@ Screen.register({
|
|||||||
local bar_x = math.floor((sw - bar_w) / 2)
|
local bar_x = math.floor((sw - bar_w) / 2)
|
||||||
local bar_h = 4
|
local bar_h = 4
|
||||||
|
|
||||||
-- TODO: Add day counter
|
Print.text_center("day " .. Context.day_count, cx, 10, Config.colors.white)
|
||||||
Print.text_center("day 1", cx, 10, Config.colors.white)
|
|
||||||
|
|
||||||
local narrative = "reflecting on my past and present\n...\nboth eventually flushed."
|
local narrative = "reflecting on my past and present\n...\nboth eventually flushed."
|
||||||
local wrapped = UI.word_wrap(narrative, 38)
|
local wrapped = UI.word_wrap(narrative, 38)
|
||||||
|
|||||||
11
inc/system/system.day.lua
Normal file
11
inc/system/system.day.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
local _day_increase_handlers = {}
|
||||||
|
|
||||||
|
function Day.increase()
|
||||||
|
Context.day_count = Context.day_count + 1
|
||||||
|
for _, handler in ipairs(_day_increase_handlers) do
|
||||||
|
handler()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
function Day.register_handler(handler)
|
||||||
|
table.insert(_day_increase_handlers, handler)
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user