55 lines
866 B
Lua
55 lines
866 B
Lua
-- CoreLibs
|
|
import "CoreLibs/object"
|
|
import "CoreLibs/graphics"
|
|
import "CoreLibs/sprites"
|
|
import "CoreLibs/timer"
|
|
import "CoreLibs/crank"
|
|
|
|
local pd <const> = playdate
|
|
local gfx <const> = pd.graphics
|
|
|
|
TAGS = {
|
|
Pickup = 1,
|
|
Player = 2,
|
|
Hazard = 3
|
|
}
|
|
|
|
Z_INDEXES = {
|
|
Ground = 100,
|
|
Pickup = 50,
|
|
Player = 20
|
|
}
|
|
|
|
local font = gfx.font.new('font/Mini Sans 2X')
|
|
|
|
gfx.setFont(font)
|
|
|
|
-- Libraries
|
|
import "lib/AnimatedSprite"
|
|
playdate.display.setRefreshRate(50)
|
|
|
|
-- Game
|
|
import "level"
|
|
|
|
level = nil
|
|
|
|
local function initialize()
|
|
-- Make it different, every time!
|
|
math.randomseed(playdate.getSecondsSinceEpoch())
|
|
|
|
-- Init all the things!
|
|
level = Level()
|
|
playdate.resetElapsedTime()
|
|
end
|
|
|
|
initialize()
|
|
|
|
function pd.update()
|
|
gfx.sprite.update()
|
|
pd.timer.updateTimers()
|
|
pd.drawFPS(10,0)
|
|
|
|
if level then
|
|
level.update()
|
|
end
|
|
end |