initial commit
This commit is contained in:
55
source/main.lua
Normal file
55
source/main.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
-- 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
|
||||
Reference in New Issue
Block a user