chore: fix overworld class name

This commit is contained in:
Kazhnuz 2021-03-21 16:20:13 +01:00
parent 78784c27b3
commit cf4a8bcd92

View file

@ -22,7 +22,7 @@
]] ]]
local Scene = require "core.modules.scenes" local Scene = require "core.modules.scenes"
local MovePlayer = Scene:extend() local OverWorld = Scene:extend()
local World = require "scenes.overworld.world" local World = require "scenes.overworld.world"
local CharsetManager = require "scenes.overworld.charsetmanager" local CharsetManager = require "scenes.overworld.charsetmanager"
@ -36,8 +36,8 @@ local EventManager = require "game.events"
local PLAYER_MESSAGE = 240 - 32 local PLAYER_MESSAGE = 240 - 32
function MovePlayer:new() function OverWorld:new()
MovePlayer.super.new(self) OverWorld.super.new(self)
self.charsetManager = CharsetManager(self) self.charsetManager = CharsetManager(self)
self.assets:batchImport("game.modules.gui.assets") self.assets:batchImport("game.modules.gui.assets")
self.assets:batchImport("scenes.overworld.assets") self.assets:batchImport("scenes.overworld.assets")
@ -66,29 +66,29 @@ function MovePlayer:new()
self.events = EventManager(self) self.events = EventManager(self)
end end
function MovePlayer:startEvent() function OverWorld:startEvent()
self.world.isActive = false self.world.isActive = false
end end
function MovePlayer:endEvent() function OverWorld:endEvent()
self.world.isActive = true self.world.isActive = true
end end
function MovePlayer:showMessage(message) function OverWorld:showMessage(message)
self.message = message self.message = message
self.messageOpacity = 1 self.messageOpacity = 1
self.tweens:newTween(0, 0.2, {messageOpacity = 1}, 'inOutCubic') self.tweens:newTween(0, 0.2, {messageOpacity = 1}, 'inOutCubic')
self.tweens:newTween(1, 0.2, {messageOpacity = 0}, 'inOutCubic') self.tweens:newTween(1, 0.2, {messageOpacity = 0}, 'inOutCubic')
end end
function MovePlayer:registerScreen(screen) function OverWorld:registerScreen(screen)
if (self.currentScreen ~= nil) then if (self.currentScreen ~= nil) then
self.currentScreen:quit() self.currentScreen:quit()
end end
self.currentScreen = screen self.currentScreen = screen
end end
function MovePlayer:update(dt) function OverWorld:update(dt)
local keys = self:getKeys(1) local keys = self:getKeys(1)
self.tweens:update(dt) self.tweens:update(dt)
self.events:update(dt) self.events:update(dt)
@ -110,7 +110,7 @@ function MovePlayer:update(dt)
end end
end end
function MovePlayer:pause() function OverWorld:pause()
self.tweens:newTween(0,0.2, {backGroundOpacity=0.75}, "inQuad") self.tweens:newTween(0,0.2, {backGroundOpacity=0.75}, "inQuad")
self.tweens:newTween(0,0.3, {borderPosition=30}, "inOutQuad") self.tweens:newTween(0,0.3, {borderPosition=30}, "inOutQuad")
self.tweens:newTween(0, 0.3, {emblemPosition=456}, "inOutQuad") self.tweens:newTween(0, 0.3, {emblemPosition=456}, "inOutQuad")
@ -121,7 +121,7 @@ function MovePlayer:pause()
screens.mainmenu.pause(self) screens.mainmenu.pause(self)
end end
function MovePlayer:unpause() function OverWorld:unpause()
self.tweens:newTween(0.1, 0.2, {backGroundOpacity=0}, "inQuad") self.tweens:newTween(0.1, 0.2, {backGroundOpacity=0}, "inQuad")
self.tweens:newTween(0, 0.3, {borderPosition=0}, "inOutQuad") self.tweens:newTween(0, 0.3, {borderPosition=0}, "inOutQuad")
self.tweens:newTween(0, 0.3, {emblemPosition=368}, "inOutQuad") self.tweens:newTween(0, 0.3, {emblemPosition=368}, "inOutQuad")
@ -135,15 +135,15 @@ function MovePlayer:unpause()
end end
end end
function MovePlayer:quitScreen() function OverWorld:quitScreen()
self.currentScreen = nil self.currentScreen = nil
end end
function MovePlayer:getEmblemsPosition() function OverWorld:getEmblemsPosition()
return self.emblemPosition return self.emblemPosition
end end
function MovePlayer:draw() function OverWorld:draw()
love.graphics.setColor(0, 0, 0, self.backGroundOpacity) love.graphics.setColor(0, 0, 0, self.backGroundOpacity)
love.graphics.rectangle("fill", 0, 0, 424, 240) love.graphics.rectangle("fill", 0, 0, 424, 240)
utils.graphics.resetColor() utils.graphics.resetColor()
@ -176,4 +176,4 @@ function MovePlayer:draw()
utils.graphics.resetColor() utils.graphics.resetColor()
end end
return MovePlayer return OverWorld