fix: don't jump at minigame start

This commit is contained in:
Kazhnuz 2020-08-16 11:03:06 +02:00
parent 70ed18202d
commit e8e5ba9a76
3 changed files with 13 additions and 3 deletions

View file

@ -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)
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

View file

@ -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

View file

@ -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