fpv/source/main.lua
2024-05-31 13:19:42 +03:00

59 lines
916 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"
import "lib/pdParticles"
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)
Particles:update()
if level then
level.update()
end
end