From c518faadef00458b6014db44d059073f5fa55957 Mon Sep 17 00:00:00 2001 From: PossiblyAxolotl Date: Fri, 29 Jul 2022 20:51:08 -0600 Subject: [PATCH] skippable cutscenes, parttest scene --- Source/Cutscenes.lua | 5 +++++ Source/Main.lua | 20 +++++++++++++++++++- Source/Menu.lua | 4 ++-- Source/Particles.lua | 14 ++++++++++++++ 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/Source/Cutscenes.lua b/Source/Cutscenes.lua index 05d637e..e58a545 100644 --- a/Source/Cutscenes.lua +++ b/Source/Cutscenes.lua @@ -154,6 +154,11 @@ function beginEndCutscene() smYl = {80,80,120} platformY = -imgEndPlatform.height mompos = -100 + + rocketadd = playdate.timer.new(400) + rocketadd.discardOnCompletion = false + local partsadd = false + song:stop() song:load("sfx/song4") diff --git a/Source/Main.lua b/Source/Main.lua index 2426aef..4b785d1 100644 --- a/Source/Main.lua +++ b/Source/Main.lua @@ -24,6 +24,12 @@ import "Editor" mode = "menu" map = "data/level.rocketbyte" +function playdate.deviceDidUnlock() +if playdate.buttonIsPressed(playdate.kButtonDown) and playdate.buttonIsPressed(playdate.kButtonB) then + mode = "partTest" +end +end + deaths = 0 energy = 0 totalEnergy = 0 @@ -65,6 +71,16 @@ menuButton, error = menu:addMenuItem("game menu", function() elseif mode == "editor" then editClose() song:play(0) + elseif mode == "startCutscene" or mode == "endCutscene" then + local ts = playdate.timer.allTimers() + song:stop() + song:load("sfx/song1") + createStars() + for i = 1, #ts, 1 do + ts[i]:remove() + end + + song:play() end if mode =="game" or mode == "play" then @@ -72,7 +88,7 @@ menuButton, error = menu:addMenuItem("game menu", function() removeMap() killBlades() end - if mode ~= "music" and mode ~= "startCutscene" and mode ~="endCutscene"then + if mode ~= "music"then totalEnergy = 0 showEnergy = false energy = 0 @@ -107,6 +123,8 @@ function playdate.update() if mode == "menu" then updateMenu() processExplosions() + elseif mode == "partTest" then + testParts() elseif mode == "startCutscene" or mode == "startCutsceneReplay" then updateStartCutscene() elseif mode == "endCutscene" then diff --git a/Source/Menu.lua b/Source/Menu.lua index 5664f62..c9fab0b 100644 --- a/Source/Menu.lua +++ b/Source/Menu.lua @@ -218,11 +218,11 @@ function menuButtonPress(name, index) mode = "game" elseif name == "START CUTSCENE" then - local m = {"BACK","WATCH START CUTSCENE", "UNSKIPPABLE"} + local m = {"BACK","WATCH START CUTSCENE"} m[0] = "dat" createMenu(m) elseif name == "END CUTSCENE" then - local m = {"BACK","WATCH END CUTSCENE","UNSKIPPABLE"} + local m = {"BACK","WATCH END CUTSCENE"} m[0] = "dat" createMenu(m) elseif name == "WATCH START CUTSCENE" then diff --git a/Source/Particles.lua b/Source/Particles.lua index 36f46bb..e988082 100644 --- a/Source/Particles.lua +++ b/Source/Particles.lua @@ -113,4 +113,18 @@ function applyStarSpeed(_x,_y) star.dx+=_x star.dy+=_y end +end + +function testParts() + gfx.clear() + processStars(-10,-10) + processExplosions() + + gfx.drawText("PARTICLES TEST", 200-(gfx.getTextSize("PARTICLES TEST")/2), 6) + gfx.drawText("BIG", 100-(gfx.getTextSize("BIG")/2), 200) + gfx.drawText("SMALL", 300-(gfx.getTextSize("SMALL")/2), 200) + if playdate.buttonJustPressed(playdate.kButtonA) then + explode(100,120) + miniExplode(300,120) + end end \ No newline at end of file