optimised and minimised imports
This commit is contained in:
parent
d06cc122b1
commit
f6ce215e35
2 changed files with 20 additions and 1 deletions
18
Source/Map.lua
Normal file
18
Source/Map.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
local tileTable <const> = gfx.imagetable.new("gfx/tiles")
|
||||
local tilemap <const> = gfx.tilemap.new()
|
||||
|
||||
tilemap:setImageTable(tileTable)
|
||||
tilemap:setSize(100,100)
|
||||
|
||||
function addMap(_file)
|
||||
local level = json.decodeFile(_file)
|
||||
for i = 1, #level.tiles, 1 do
|
||||
tilemap:setTileAtPosition(level.tiles[i].x,level.tiles[i].y,level.tiles[i].t)
|
||||
end
|
||||
|
||||
gfx.sprite.addWallSprites(tilemap, {0,1})
|
||||
end
|
||||
|
||||
function drawTiles()
|
||||
tilemap:draw(0,0)
|
||||
end
|
|
@ -1,7 +1,8 @@
|
|||
import "CoreLibs/math"
|
||||
|
||||
local velocity = {x=0,y=0}
|
||||
local lerpmnt <const> = 0.5
|
||||
local grav <const> = 0.2
|
||||
local gfx <const> = playdate.graphics
|
||||
local active = false
|
||||
|
||||
local imgRocket = gfx.image.new("gfx/rocket")
|
||||
|
|
Loading…
Reference in a new issue