From e8e5ba9a769e95aa9be4a3853b6c11ac408a0e51 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 16 Aug 2020 11:03:06 +0200 Subject: [PATCH] fix: don't jump at minigame start --- sonic-radiance.love/game/modules/subgames/init.lua | 13 +++++++++++-- .../game/modules/world/actors/player/init.lua | 2 +- sonic-radiance.love/scenes/debug/commons/menu.lua | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sonic-radiance.love/game/modules/subgames/init.lua b/sonic-radiance.love/game/modules/subgames/init.lua index 71fe8d7..412706d 100644 --- a/sonic-radiance.love/game/modules/subgames/init.lua +++ b/sonic-radiance.love/game/modules/subgames/init.lua @@ -18,7 +18,7 @@ function PlayStyle:new(supportedLevels, missionfile) self:initMission() self:initCharacters() - self:startLevel() + self.haveStarted = false end function PlayStyle:loadMissionFile(supportedLevels, missionfile) @@ -44,7 +44,15 @@ function PlayStyle:getCharacterName(charID) end function PlayStyle:update(dt) - PlayStyle.super.update(self, dt) + if (self.haveStarted) then + PlayStyle.super.update(self, dt) + self:updatePauseMenus(dt) + else + self:startLevel() + end +end + +function PlayStyle:updatePauseMenus(dt) if self.menusystem.menus["pauseMenu"].isActive == false then self.timer = self.timer + dt end @@ -68,6 +76,7 @@ function PlayStyle:update(dt) end function PlayStyle:startLevel() + self.haveStarted = true self.world:loadMap() --self.assets:playMusic() end diff --git a/sonic-radiance.love/game/modules/world/actors/player/init.lua b/sonic-radiance.love/game/modules/world/actors/player/init.lua index 05e4aea..11beea2 100644 --- a/sonic-radiance.love/game/modules/world/actors/player/init.lua +++ b/sonic-radiance.love/game/modules/world/actors/player/init.lua @@ -31,7 +31,7 @@ function Player:updateStart(dt) self:basicMovements() - if self.keys["A"].isDown and (self.onGround) then + if self.keys["A"].isPressed and (self.onGround) then self.zsp = 280*1.33 end diff --git a/sonic-radiance.love/scenes/debug/commons/menu.lua b/sonic-radiance.love/scenes/debug/commons/menu.lua index 8f03803..c2ec6e6 100644 --- a/sonic-radiance.love/scenes/debug/commons/menu.lua +++ b/sonic-radiance.love/scenes/debug/commons/menu.lua @@ -72,6 +72,7 @@ function menu.SceneWidget:new(scene, menuName, newScene, newSceneName, sceneArgu end function menu.SceneWidget:action() + self.scene:flushKeys() if (self.sceneArgument ~= nil) then self.newScene(self.sceneArgument) else