skippable cutscenes, parttest scene

This commit is contained in:
PossiblyAxolotl 2022-07-29 20:51:08 -06:00
parent 6144b1b433
commit c518faadef
4 changed files with 40 additions and 3 deletions

View file

@ -154,6 +154,11 @@ function beginEndCutscene()
smYl = {80,80,120} smYl = {80,80,120}
platformY = -imgEndPlatform.height platformY = -imgEndPlatform.height
mompos = -100 mompos = -100
rocketadd = playdate.timer.new(400)
rocketadd.discardOnCompletion = false
local partsadd = false
song:stop() song:stop()
song:load("sfx/song4") song:load("sfx/song4")

View file

@ -24,6 +24,12 @@ import "Editor"
mode = "menu" mode = "menu"
map = "data/level.rocketbyte" map = "data/level.rocketbyte"
function playdate.deviceDidUnlock()
if playdate.buttonIsPressed(playdate.kButtonDown) and playdate.buttonIsPressed(playdate.kButtonB) then
mode = "partTest"
end
end
deaths = 0 deaths = 0
energy = 0 energy = 0
totalEnergy = 0 totalEnergy = 0
@ -65,6 +71,16 @@ menuButton, error = menu:addMenuItem("game menu", function()
elseif mode == "editor" then elseif mode == "editor" then
editClose() editClose()
song:play(0) 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 end
if mode =="game" or mode == "play" then if mode =="game" or mode == "play" then
@ -72,7 +88,7 @@ menuButton, error = menu:addMenuItem("game menu", function()
removeMap() removeMap()
killBlades() killBlades()
end end
if mode ~= "music" and mode ~= "startCutscene" and mode ~="endCutscene"then if mode ~= "music"then
totalEnergy = 0 totalEnergy = 0
showEnergy = false showEnergy = false
energy = 0 energy = 0
@ -107,6 +123,8 @@ function playdate.update()
if mode == "menu" then if mode == "menu" then
updateMenu() updateMenu()
processExplosions() processExplosions()
elseif mode == "partTest" then
testParts()
elseif mode == "startCutscene" or mode == "startCutsceneReplay" then elseif mode == "startCutscene" or mode == "startCutsceneReplay" then
updateStartCutscene() updateStartCutscene()
elseif mode == "endCutscene" then elseif mode == "endCutscene" then

View file

@ -218,11 +218,11 @@ function menuButtonPress(name, index)
mode = "game" mode = "game"
elseif name == "START CUTSCENE" then elseif name == "START CUTSCENE" then
local m = {"BACK","WATCH START CUTSCENE", "UNSKIPPABLE"} local m = {"BACK","WATCH START CUTSCENE"}
m[0] = "dat" m[0] = "dat"
createMenu(m) createMenu(m)
elseif name == "END CUTSCENE" then elseif name == "END CUTSCENE" then
local m = {"BACK","WATCH END CUTSCENE","UNSKIPPABLE"} local m = {"BACK","WATCH END CUTSCENE"}
m[0] = "dat" m[0] = "dat"
createMenu(m) createMenu(m)
elseif name == "WATCH START CUTSCENE" then elseif name == "WATCH START CUTSCENE" then

View file

@ -113,4 +113,18 @@ function applyStarSpeed(_x,_y)
star.dx+=_x star.dx+=_x
star.dy+=_y star.dy+=_y
end 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 end