@@ -413,6 +413,13 @@ local function addPieceToInertGrid()
413413 end )
414414end
415415
416+ function addSash (message )
417+ if sash then
418+ table.insert (sashes , Sash (message ))
419+ screenClearNeeded = true
420+ end
421+ end
422+
416423reset ()
417424
418425local function lose ()
@@ -536,13 +543,13 @@ local function updateGame()
536543 if clearedLines >= 4 then
537544 stopAllComboSounds ()
538545 tetrisSound :play ()
539- if sash then table.insert ( sashes , Sash ( " Playtris!" )) end
546+ addSash ( " Playtris!" )
540547 scoreGoal += 15 * combo
541548 end
542549
543550 if allclear and sash then
544551 scoreGoal += 25 * combo
545- table.insert ( sashes , Sash ( " All clear!" ) )
552+ addSash ( " All clear!" )
546553 end
547554
548555 if not completedLine then
@@ -640,12 +647,14 @@ local function drawGame()
640647 refreshNeeded = true
641648 displayYPos += ((0 - displayYPos )* 0.25 )
642649
643- -- Just clean up the area below the grid instead of a full screen clear
644- gfx .setColor (darkMode and gfx .kColorBlack or gfx .kColorWhite )
645- gfx .fillRect (
646- offsetX * blockSize , dheight - offsetY * blockSize ,
647- gridXCount * blockSize , offsetY * blockSize
648- )
650+ -- Just clean up the area below the grid if the whole screen wasn't cleared
651+ if not screenWasCleared then
652+ gfx .setColor (darkMode and gfx .kColorBlack or gfx .kColorWhite )
653+ gfx .fillRect (
654+ offsetX * blockSize , dheight - offsetY * blockSize ,
655+ gridXCount * blockSize , offsetY * blockSize
656+ )
657+ end
649658
650659 gfx .setDrawOffset (0 ,displayYPos )
651660
@@ -1114,6 +1123,7 @@ function playdate.deviceWillSleep() commitSaveData() end
11141123
11151124function playdate .keyPressed (key )
11161125 if key == " L" then
1126+ forceInertGridRefresh = true
11171127 for i = 1 , 4 do table.remove (inert ) end
11181128 for i = 1 , 4 do
11191129 table.insert (inert , (function ()
@@ -1126,6 +1136,7 @@ function playdate.keyPressed(key)
11261136 end )())
11271137 end
11281138 elseif key == " T" then
1139+ forceInertGridRefresh = true
11291140 -- Generate a TSpin scenario
11301141 for i = 1 , 5 do table.remove (inert ) end
11311142 table.insert (inert , {" *" , " *" , " *" , " " , " " , " " , " " , " *" , " *" , " *" })
0 commit comments