warning for lag
This commit is contained in:
parent
cda62e0efd
commit
4b68a6ff67
4 changed files with 18 additions and 18 deletions
|
@ -48,6 +48,7 @@ local imgExitMen = gfx.image.new("gfx/leave")
|
||||||
local imgSaw = gfx.imagetable.new("gfx/sawblades")
|
local imgSaw = gfx.imagetable.new("gfx/sawblades")
|
||||||
local imgTarget = gfx.image.new("gfx/target")
|
local imgTarget = gfx.image.new("gfx/target")
|
||||||
local imgGrid = gfx.image.new("gfx/grid")
|
local imgGrid = gfx.image.new("gfx/grid")
|
||||||
|
local imgWarn = gfx.image.new("gfx/warningsign")
|
||||||
assert(imgFloppy)
|
assert(imgFloppy)
|
||||||
assert(imgAdd)
|
assert(imgAdd)
|
||||||
assert(imgMus)
|
assert(imgMus)
|
||||||
|
@ -62,6 +63,7 @@ assert(imgPlayerExit)
|
||||||
assert(imgSaw)
|
assert(imgSaw)
|
||||||
assert(imgTarget)
|
assert(imgTarget)
|
||||||
assert(imgGrid)
|
assert(imgGrid)
|
||||||
|
assert(imgWarn)
|
||||||
|
|
||||||
local animFloppy = gfx.animation.loop.new(100, imgFloppy)
|
local animFloppy = gfx.animation.loop.new(100, imgFloppy)
|
||||||
|
|
||||||
|
@ -485,6 +487,8 @@ function editUpdate()
|
||||||
gfx.drawText("MOVERS",0,0)
|
gfx.drawText("MOVERS",0,0)
|
||||||
elseif math.floor( tileIndex ) == 3 then
|
elseif math.floor( tileIndex ) == 3 then
|
||||||
gfx.drawText("SPINNERS",0,0)
|
gfx.drawText("SPINNERS",0,0)
|
||||||
|
imgWarn:draw(0,18)
|
||||||
|
gfx.drawText("VERY LAGGY",18,18)
|
||||||
elseif math.floor( tileIndex ) == 4 then
|
elseif math.floor( tileIndex ) == 4 then
|
||||||
gfx.drawText("PLAYER",0,0)
|
gfx.drawText("PLAYER",0,0)
|
||||||
elseif math.floor( tileIndex ) == 5 then
|
elseif math.floor( tileIndex ) == 5 then
|
||||||
|
|
|
@ -30,7 +30,6 @@ next = nil
|
||||||
local gfx <const> = playdate.graphics
|
local gfx <const> = playdate.graphics
|
||||||
local disp <const> = playdate.display
|
local disp <const> = playdate.display
|
||||||
local font <const> = gfx.font.new("gfx/big")
|
local font <const> = gfx.font.new("gfx/big")
|
||||||
small = gfx.font.new("gfx/font(1)")
|
|
||||||
|
|
||||||
gfx.setFont(font)
|
gfx.setFont(font)
|
||||||
gfx.setBackgroundColor(gfx.kColorBlack)
|
gfx.setBackgroundColor(gfx.kColorBlack)
|
||||||
|
@ -138,9 +137,3 @@ function playdate.gameWillTerminate()
|
||||||
playdate.datastore.write({savedLevel=map,savedDeaths=deaths},"savegame")
|
playdate.datastore.write({savedLevel=map,savedDeaths=deaths},"savegame")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function playdate.debugDraw()
|
|
||||||
gfx.setDrawOffset(0,0)
|
|
||||||
playdate.drawFPS(0,228)
|
|
||||||
small:drawText(math.floor( playdate.getCrankPosition() ), 0, 218)
|
|
||||||
end
|
|
|
@ -56,11 +56,13 @@ function loadSpins(_spins)
|
||||||
s.middle:add()
|
s.middle:add()
|
||||||
|
|
||||||
local sb = {speed=s.speed,arms={},mid=s.middle,time=0}
|
local sb = {speed=s.speed,arms={},mid=s.middle,time=0}
|
||||||
--local sb = {speed=s.speed,arms=s.arms,armlen=s.armlen,saws = {},arcs = {},time=0}
|
--[[local sb = {speed=s.speed,layers={},time=0}
|
||||||
|
|
||||||
--[[for len = 1, s.armlen, 1 do
|
for len = 1, s.armlen, 1 do
|
||||||
local arc = playdate.geometry.arc.new(s.x,s.y, 20 * len, -720, 720)
|
local arc = playdate.geometry.arc.new(s.x,s.y, 20 * len, -720, 720)
|
||||||
|
|
||||||
|
sb.layers[#sb.layers+1] = {curve=arc,saws={}}
|
||||||
|
|
||||||
for arm = 1, s.arms, 1 do
|
for arm = 1, s.arms, 1 do
|
||||||
local saw = gfx.sprite.new(loopSaws:image())
|
local saw = gfx.sprite.new(loopSaws:image())
|
||||||
local sawPos = arc:pointOnArc(360 / s.arms * arm)
|
local sawPos = arc:pointOnArc(360 / s.arms * arm)
|
||||||
|
@ -68,11 +70,12 @@ function loadSpins(_spins)
|
||||||
saw:moveTo(sawPos.x,sawPos.y)
|
saw:moveTo(sawPos.x,sawPos.y)
|
||||||
saw:add()
|
saw:add()
|
||||||
|
|
||||||
sb.saws[#sb.saws+1] = saw
|
sb.layers[#sb.layers].saws[#sb.layers[#sb.layers].saws+1] = saw
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
sb.arcs[#sb.arcs+1] = arc
|
spinblades[#spinblades+1] = sb]]
|
||||||
end]]
|
|
||||||
|
|
||||||
for i = 1, s.arms, 1 do
|
for i = 1, s.arms, 1 do
|
||||||
sb.arms[i] = {}
|
sb.arms[i] = {}
|
||||||
|
@ -146,14 +149,14 @@ function updateSaws()
|
||||||
s.time += s.speed
|
s.time += s.speed
|
||||||
print(s.time)
|
print(s.time)
|
||||||
|
|
||||||
for len = 1, s.armlen, 1 do
|
for len = 1, #s.layers, 1 do
|
||||||
local arc = s.arcs[len]
|
local arc = s.layers[len].curve
|
||||||
|
|
||||||
for arm = 1, s.arms, 1 do
|
for arm = 1, #s.layers[len].saws, 1 do
|
||||||
local sawPos = arc:pointOnArc(arc:length() / 4 / s.arms * arm + (s.time * len))
|
local sawPos = arc:pointOnArc(arc:length() / 4 / #s.layers[len].saws * arm + (s.time * len))
|
||||||
if s.time > 125 * s.arms or s.time < -125 * s.arms then s.time = 0 end
|
if s.time > 125 * #s.layers[len].saws or s.time < -125 * #s.layers[len].saws then s.time = 0 end
|
||||||
|
|
||||||
s.saws[arm+((len)*(arm-1))]:moveTo(sawPos.x,sawPos.y)
|
s.layers[len].saws[arm]:moveTo(sawPos.x,sawPos.y)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end]]
|
end]]
|
||||||
|
|
BIN
Source/gfx/warningsign.png
Normal file
BIN
Source/gfx/warningsign.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 160 B |
Loading…
Reference in a new issue