2020-08-01 16:57:12 +02:00
|
|
|
-- scenes/moveplayer :: a basic player movement example
|
|
|
|
|
|
|
|
--[[
|
|
|
|
Copyright © 2019 Kazhnuz
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
|
this software and associated documentation files (the "Software"), to deal in
|
|
|
|
the Software without restriction, including without limitation the rights to
|
|
|
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
|
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
|
|
subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
|
|
copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
|
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
|
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
]]
|
|
|
|
|
2019-04-01 09:08:53 +02:00
|
|
|
local Scene = require "core.modules.scenes"
|
2020-08-01 16:57:12 +02:00
|
|
|
local MovePlayer = Scene:extend()
|
|
|
|
|
|
|
|
local World = require "scenes.overworld.world"
|
2020-08-01 18:54:12 +02:00
|
|
|
local CharsetManager = require "scenes.overworld.charsetmanager"
|
2019-04-01 09:08:53 +02:00
|
|
|
|
2020-08-01 16:57:12 +02:00
|
|
|
function MovePlayer:new()
|
|
|
|
MovePlayer.super.new(self)
|
2020-08-01 18:54:12 +02:00
|
|
|
self.charsetManager = CharsetManager(self)
|
2020-08-03 10:28:18 +02:00
|
|
|
self.assets:batchImport("game.modules.gui.assets")
|
2020-08-02 15:56:36 +02:00
|
|
|
self.assets:batchImport("scenes.overworld.assets")
|
2020-08-01 16:57:12 +02:00
|
|
|
|
|
|
|
World(self, "test", "map")
|
|
|
|
self.world:setPlayerNumber(1)
|
|
|
|
self.world:loadMap()
|
2019-04-01 09:08:53 +02:00
|
|
|
end
|
|
|
|
|
2020-08-01 16:57:12 +02:00
|
|
|
function MovePlayer:update(dt)
|
2020-08-01 18:54:12 +02:00
|
|
|
self.charsetManager:update(dt)
|
2019-04-01 09:08:53 +02:00
|
|
|
end
|
|
|
|
|
2020-08-01 16:57:12 +02:00
|
|
|
function MovePlayer:draw()
|
2019-04-01 09:08:53 +02:00
|
|
|
|
|
|
|
end
|
|
|
|
|
2020-08-01 16:57:12 +02:00
|
|
|
return MovePlayer
|