diff --git a/characters/bf-dark.json b/characters/bf-dark.json index c80e61c..0f58f76 100644 --- a/characters/bf-dark.json +++ b/characters/bf-dark.json @@ -127,7 +127,7 @@ "image": "sprites/characters/bf_dark", "position": [ 0, - 350 + 700 ], "healthicon": "bf", "flip_x": false, diff --git a/characters/spooky-dark.json b/characters/spooky-dark.json index a6a6a64..dd12008 100644 --- a/characters/spooky-dark.json +++ b/characters/spooky-dark.json @@ -101,7 +101,7 @@ "image": "sprites/characters/spooky_dark", "position": [ 0, - 200 + 400 ], "healthicon": "spooky", "flip_x": false, diff --git a/stages/spookyErect.lua b/stages/spookyErect.lua index fc828c8..00e8f86 100644 --- a/stages/spookyErect.lua +++ b/stages/spookyErect.lua @@ -4,7 +4,7 @@ return { onCreate = function(song) local trees = Sprite("sprites/spooky/erect/bgtrees.png", "sprites/spooky/erect/bgtrees.json") trees:PlayAnimation("bgtrees", 5, true) - trees.position = Vector2(100, 0) + trees.position = Vector2(200, 0) trees.modifier = 0.8 trees.layer = -2 diff --git a/stages/stageErect.lua b/stages/stageErect.lua index 77ef81c..74e78c2 100644 --- a/stages/stageErect.lua +++ b/stages/stageErect.lua @@ -8,7 +8,7 @@ return { local crowd = Sprite("sprites/stage/erect/crowd.png", "sprites/stage/erect/crowd.json") crowd:PlayAnimation("Symbol 2 instance 1", 24, true) - crowd.position = Vector2(560, 150) + crowd.position = Vector2(560, 300) crowd.modifier = 0.8 crowd.layer = -9 diff --git a/states/menustate.lua b/states/menustate.lua index ef7dc66..fbc1d76 100644 --- a/states/menustate.lua +++ b/states/menustate.lua @@ -8,7 +8,8 @@ local defaultSettings = { -- The way its in the JSON "b", "up", "right" - } + }, + Offset = 0 } return function() ---@class StateClass @@ -43,6 +44,15 @@ return function() os.execute("mkdir "..data) files.write_file(data.."/Settings.json", json.stringify(defaultSettings)) print("Written") + else + settings = json.parse(settings) + --Incase the settings are old + for index, setting in next, defaultSettings do + if not settings[index] then + settings[index] = setting + end + end + files.write_file(data.."/Settings.json", json.stringify(settings)) end if not freaky then diff --git a/states/optionsstate.lua b/states/optionsstate.lua index cfe88eb..cc2daf5 100644 --- a/states/optionsstate.lua +++ b/states/optionsstate.lua @@ -10,7 +10,8 @@ local settingList = { -- Path for the positions in JSON Down = "Keybinds.2", Up = "Keybinds.3", Right = "Keybinds.4", - Downscroll = "Downscroll" + Downscroll = "Downscroll", + Offset = "Offset" } local categoryList = { -- The way its on the screen @@ -26,7 +27,8 @@ local categoryList = { -- The way its on the screen { name = "Gameplay", settings = { - "Downscroll" + "Downscroll", + "Offset" } } } @@ -97,6 +99,16 @@ return function() files.write_file(data.."/Settings.json", json.stringify(settings)) state.changeState("menustate") + elseif key == "right" or key == "left" then + + local listSetting = globalList[currentSetting] + if categories[listSetting] then return end + local settingPath, settingLast = getSettingPath(listSetting) + local setting = settingPath[settingLast] + + if type(setting) == "number" then + settingPath[settingLast] = settingPath[settingLast] + (key == "right" and 1 or -1) + end end end diff --git a/states/playstate.lua b/states/playstate.lua index 03c0338..fe7357e 100644 --- a/states/playstate.lua +++ b/states/playstate.lua @@ -145,6 +145,7 @@ local function state(songName, songDifficulty, show) local splashes = {} local keyBinds = {} -- loaded from settings.json, if anything's wrong then try rebinding in the menu + local offset = 0 local paused = false local elapsed = 0 @@ -508,9 +509,9 @@ local function state(songName, songDifficulty, show) end - inst:seek(elapsed / 1000 > 0 and elapsed / 1000 or 0, "seconds") + inst:seek((elapsed + offset) / 1000 > 0 and (elapsed + offset) / 1000 or 0, "seconds") if chart.needsVoices then - voices:seek(elapsed / 1000 > 0 and elapsed / 1000 or 0, "seconds") + voices:seek((elapsed + offset) / 1000 > 0 and (elapsed + offset) / 1000 or 0, "seconds") end end @@ -989,6 +990,7 @@ local function state(songName, songDifficulty, show) render.cameraTarget = Vector2() keyBinds = settings.Keybinds + offset = settings.Offset state.loaded = true