From b2c881a1390d0f632c842d45bfbcd98820317473 Mon Sep 17 00:00:00 2001 From: PossiblyAxolotl Date: Tue, 9 Aug 2022 13:51:07 -0600 Subject: [PATCH] 1.2.0 --- Source/Editor.lua | 33 ++++++++++++++++------ Source/Map.lua | 1 + Source/Menu.lua | 8 +++++- Source/Player.lua | 4 +++ Source/Saws.lua | 39 ++++++++++++++++++++++++++ Source/gfx/checkp.png | Bin 0 -> 174 bytes Source/gfx/checkpEditor.png | Bin 0 -> 275 bytes Source/gfx/checkpoint-table-32-32.png | Bin 0 -> 930 bytes Source/pdxinfo | 4 +-- 9 files changed, 78 insertions(+), 11 deletions(-) create mode 100644 Source/gfx/checkp.png create mode 100644 Source/gfx/checkpEditor.png create mode 100644 Source/gfx/checkpoint-table-32-32.png diff --git a/Source/Editor.lua b/Source/Editor.lua index 76e2688..3a6cd46 100644 --- a/Source/Editor.lua +++ b/Source/Editor.lua @@ -30,7 +30,7 @@ local grav = 0.2 local imgFloppy = gfx.imagetable.new("gfx/floppyT") local imgAdd = gfx.image.new("gfx/add") -local imgMus = gfx.image.new("gfx/music") +local imgMus = gfx.image.new("gfx/checkpEditor") local imgLine = gfx.image.new("gfx/line") local imgSpin = gfx.image.new("gfx/spin") local imgCursor = gfx.image.new("gfx/cursor2") @@ -72,6 +72,7 @@ local position = {x=100,y=100} local positionLerp = {x=0,y=0} local powers = {} +local checks = {} function newProject() mode = "newproj" @@ -101,6 +102,7 @@ function editLoadName(name) playerPos = {x = data.rocket.x, y = data.rocket.y} exitPos = {x = data.bigrocket.x, y = data.bigrocket.y} position = {x = (data.rocket.x + 6) / 16, y = (data.rocket.y + 4)/16} + if data.checks then checks = data.checks end levelname = name:match("(.+)%..+$") playdate.display.setInverted(data.inverted) grav = data.grav or 0.2 @@ -112,7 +114,7 @@ function editLoadName(name) tiles[tile] = {x=data.tiles[tile].x,y=data.tiles[tile].y,t=data.tiles[tile].t} end altClrButton = playdate.getSystemMenu():addMenuItem("level settings", function() - local m = {"NO GRAVITY","NEGATIVE GRAVITY","REGULAR GRAVITY","INVERT COLOURS","RESUME"} + local m = {"NO GRAVITY","NEGATIVE GRAVITY","REGULAR GRAVITY","INVERT COLOURS","CHANGE MUSIC","RESUME"} createMenu(m, true) end) toolTipButton = playdate.getSystemMenu():addMenuItem("save", function() @@ -137,8 +139,8 @@ function playdate.keyboard.keyboardWillHideCallback(ok) saveTime = 0 grav=0.2 song:stop() - playdate.getSystemMenu():addCheckmarkMenuItem("level settings", function() - local m = {"NO GRAVITY","NEGATIVE GRAVITY","REGULAR GRAVITY","INVERT LEVEL COLOURS","RESUME"} + playdate.getSystemMenu():addMenuItem("level settings", function() + local m = {"NO GRAVITY","NEGATIVE GRAVITY","REGULAR GRAVITY","INVERT COLOURS","CHANGE MUSIC","RESUME"} createMenu(m, true) end) playdate.getSystemMenu():addMenuItem("save",false, function() @@ -173,7 +175,7 @@ local curYlerp = -32 function editSave() playdate.datastore.delete("levels/"..levelname..".json") saveTime = 5 - playdate.datastore.write({song=selSong, grav=grav, tiles = tiles, inverted = playdate.display.getInverted(), rocket=playerPos, bigrocket=exitPos, fuel = powers,saws=sawblades,rotators=spins},"levels/"..levelname) + playdate.datastore.write({song=selSong, grav=grav, tiles = tiles, inverted = playdate.display.getInverted(), checks=checks, rocket=playerPos, bigrocket=exitPos, fuel = powers,saws=sawblades,rotators=spins},"levels/"..levelname) end local traveltime = 1 @@ -235,7 +237,6 @@ function editUpdate() song:stop() song:load("sfx/song1") end - tileIndex = 6 songIndexSel = #editorSongs + 1 elseif editor == "pos2Spin" then spins[#spins+1] = {middle=true,x=pos1.x,y=pos1.y,speed=traveltime,arms=armamount,armlen=armlength} @@ -275,7 +276,7 @@ function editUpdate() elseif math.floor(tileIndex) == 5 then exitPos = {x = (position.x + 11) * 16, y = (position.y + 7) * 16} elseif math.floor(tileIndex) == 6 then - editor = "music" + checks[#checks+1] = {x = ((position.x + 11) * 16) - 7, y = ((position.y + 7) * 16) - 5} elseif math.floor(tileIndex) == 7 then editor = "view" end @@ -328,6 +329,13 @@ function editUpdate() break end end + elseif math.floor( tileIndex ) == 6 then + for check = 1, #checks, 1 do + if checks[check].x == (position.x + 11) * 16-7 and checks[check].y == (position.y + 7) * 16-5 then + table.remove(checks, check) + break + end + end end elseif editor == "view" then editor = "main" @@ -429,6 +437,10 @@ end imgSquare:draw(powers[power].x,powers[power].y) end + for check = 1, #checks, 1 do + imgMus:draw(checks[check].x,checks[check].y) + end + if editor ~= "view" then imgGrid:drawTiled((position.x-2)*16,(position.y-2)*16,416,288) imgCursor:draw((position.x + 11) * 16, (position.y + 7) * 16) @@ -502,7 +514,7 @@ end elseif math.floor( tileIndex ) == 5 then gfx.drawText("EXIT",0,0) elseif math.floor( tileIndex ) == 6 then - gfx.drawText("MUSIC",0,0) + gfx.drawText("CHECKPOINTS",0,0) elseif math.floor( tileIndex ) == 7 then gfx.drawText("VIEW",0,0) end @@ -530,6 +542,7 @@ function editClose() powers = {} sawblades = {} spins = {} + checks = {} editor = "main" tileIndex = 0 playdate.display.setInverted(false) @@ -544,6 +557,10 @@ function setGrav(val) grav = val end +function setEditor(val) + editor = val +end + local gravs = {[0.2]="REGULAR",[0]="NONE",[-0.2]="NEGATIVE"} function getGrav() diff --git a/Source/Map.lua b/Source/Map.lua index 763f3f6..46aa01b 100644 --- a/Source/Map.lua +++ b/Source/Map.lua @@ -48,6 +48,7 @@ function addMap(_file, rs) if level.inverted then playdate.display.setInverted(true) else playdate.display.setInverted(false) end if level.saws then loadBlades(level.saws) end if level.rotators then loadSpins(level.rotators) end + if level.checks then loadChecks(level.checks) end if level.fuel then loadFuel(level.fuel) end grav = level.grav or 0.2 if level.next then next = level.next end diff --git a/Source/Menu.lua b/Source/Menu.lua index 5fbc960..dbe1758 100644 --- a/Source/Menu.lua +++ b/Source/Menu.lua @@ -237,6 +237,10 @@ function menuButtonPress(name, index) barpos = 160 logopos = -112 + elseif name == "CHANGE MUSIC" then + setEditor("music") + mode = "editor" + elseif name == "START CUTSCENE" then local m = {"BACK","WATCH START CUTSCENE"} m[0] = "dat" @@ -312,7 +316,9 @@ function menuButtonPress(name, index) elseif menu == "qrs" or menu == "data" or menu == "dat" then local m = {} m[0],m[1], m[2], m[3], m[4], m[5], m[6] = "extras", "BACK","LINKS","END CUTSCENE", "START CUTSCENE", "MUSIC BOX", "LEVEL SELECT" - createMenu(m) + createMenu(m) + elseif menu == nil then + else createMenu(mainmenu) end diff --git a/Source/Player.lua b/Source/Player.lua index ddad6c2..4e0f24f 100644 --- a/Source/Player.lua +++ b/Source/Player.lua @@ -32,6 +32,10 @@ local resetButton = nil local sfxDie = playdate.sound.sampleplayer.new("sfx/die") +function setSpawn(_x,_y) + startpos = {x=_x,y=_y} +end + local function die() deaths +=1 explode(sprRocket.x,sprRocket.y) diff --git a/Source/Saws.lua b/Source/Saws.lua index 40e4c62..7780247 100644 --- a/Source/Saws.lua +++ b/Source/Saws.lua @@ -3,15 +3,20 @@ local gfx = playdate.graphics local imgSaw = gfx.imagetable.new("gfx/sawblades") local imgFuel = gfx.imagetable.new("gfx/fuel") local imgTarget = gfx.image.new("gfx/target") +local imgCheck = gfx.imagetable.new("gfx/checkpoint") assert(imgSaw) +assert(imgFuel) assert(imgTarget) +assert(imgCheck) local loopSaws = gfx.animation.loop.new(200, imgSaw) local loopFuel = gfx.animation.loop.new(400, imgFuel) +local loopCheck = gfx.animation.loop.new(300, imgCheck) local blades = {} local spinblades = {} local fuels = {} +local checks = {} local sfxCollect = playdate.sound.sampleplayer.new("sfx/collect") @@ -108,6 +113,21 @@ function loadFuel(_fuel) end end +function loadChecks(_checks) + + for i = 1, #_checks, 1 do + local check = _checks[i] + checks[i] = gfx.sprite.new() + checks[i].set = false + checks[i]:moveTo(check.x+16,check.y+16) + checks[i]:setGroups({2}) + checks[i]:setCollidesWithGroups({3}) + checks[i]:setZIndex(3) + checks[i]:setCollideRect(-6,-6 ,30,30) + checks[i]:add() + end +end + function updateSaws() local ox, oy = gfx.getDrawOffset() for fuel = 1, #fuels, 1 do @@ -123,6 +143,20 @@ function updateSaws() end end + for check = 1, #checks, 1 do + checks[check]:setImage(loopCheck:image()) + if #checks[check]:overlappingSprites() > 0 and checks[check].set == false then + for check = 1, #checks, 1 do + checks[check].set = false + end + setSpawn(checks[check].x,checks[check].y) + miniExplode(checks[check].x,checks[check].y) + sfxCollect:play() + checks[check].set = true + break + end + end + for b=1, #blades, 1 do b = blades[b] b.saw:setImage(loopSaws:image()) @@ -181,6 +215,11 @@ function killBlades() end fuels = {} + for check = 1, #checks, 1 do + checks[check]:remove() + end + checks = {} + for i = 1, #blades, 1 do blades[i].t1:remove() blades[i].t2:remove() diff --git a/Source/gfx/checkp.png b/Source/gfx/checkp.png new file mode 100644 index 0000000000000000000000000000000000000000..911dd0326a951fd712c83ddfaa8ac6535d7f0a89 GIT binary patch literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^azHG_!3HE3EPS&CNR@iJIEHw1KE1M$ufc%BH8AVR zfBPNHb3I&gxp)sdzgu>3)@6^*Raf`u$L!sow~}?HZ?@b$e)rNS`54c=54#pG69G|9C8r?6oJ6@)&sJ zz!u^vwkMIwUTPii_pygKiq);MP+*k{?7kMLTQ2@t4SaMT3xD+`631h^Kdt9m2><5V ZAFevImb2n()eisw002ovPDHLkV1k#?e8K<# literal 0 HcmV?d00001 diff --git a/Source/gfx/checkpoint-table-32-32.png b/Source/gfx/checkpoint-table-32-32.png new file mode 100644 index 0000000000000000000000000000000000000000..7e1e1b811e173186ade4b3c652e055e14dbb8fbc GIT binary patch literal 930 zcmV;T16}-yP)Iy<${GFNQv!Hpvu0N^ zi#svSr_<>F&%;4PM1DR$pY3aJ`8*uD%XXv3yN8E4%>V%Ib=b0&J=cLswr%LzQie3 z0#qOXqD6iFqsBif002np`W-+m^Y>;nOJ_`-fwa9rrmr*8Xhxy}xo$W5p9%z-WXr&# z$3H3n07$AI%&?;;1~XG9BJ#4^iAa4WwA^ossl^Z)T$cX`6xA_-d^TY!GKw{I$(JpYF};|9i2= zKX|+tKdS$;WZ=+4G{?HAvN!Rr@gAj%%M?w|59 zAbVU>-Dqb~{I%Hlzuw+P@mtaOwaj;I-=+Uso&S%Ik5X#4;T4F`@sA1s0FvqoGsE?{ z;p0mU+PgW!Z!NyfI2K$3)pq34&aC*yd-&M6-s%o}jZs$tdGQPTc{9Gf=BU?D3%`6Et-|nDE7<32Y`j7{i{h`P7QdCP z9{*PQzt#D#tAL_D|K2aGTaABI005AbTLEOrz-#v^vA-9Xnt{~TRol3=b;DCLFmKg@ zx31ZXZ!PVAYiazoxa+!KUpsfBJMz|z-^+LD|JLWf)#~#fJ^oPv06lC1)v0sw%d{+ZQm=DzkiVAg*Fz&20;06L(ZPyhe` literal 0 HcmV?d00001 diff --git a/Source/pdxinfo b/Source/pdxinfo index a46976c..9ffadc1 100644 --- a/Source/pdxinfo +++ b/Source/pdxinfo @@ -3,6 +3,6 @@ author=PossiblyAxolotl description=Help a crew of rockets collect energy to get back home! bundleID=com.PossiblyAxolotl.RocketBytes launchSoundPath=launcher/rocketing -version=1.1.3 -buildNumber=1 +version=1.2.0 +buildNumber=10200 imagePath=launcher \ No newline at end of file