From 1ca55f777f92a3178975c0cf3d7860fd83dbcf45 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sun, 14 Feb 2021 15:10:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=8F=E5=B0=8F=E5=B0=8F=E6=B8=B8=E6=88=8Fjg?= =?UTF-8?q?t=E8=BE=BE=E5=88=B012=E6=97=B6=E7=9A=84=E9=9A=BE=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/scenes/mg_jgt.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/parts/scenes/mg_jgt.lua b/parts/scenes/mg_jgt.lua index 2b3d17e1..7fc1eaf1 100644 --- a/parts/scenes/mg_jgt.lua +++ b/parts/scenes/mg_jgt.lua @@ -23,11 +23,11 @@ local tileColor={ {.78, .55, .04}, {.12, .12, .51}, } -local newTile={0,2,2,2,3,3,3,3,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5} local board,cx,cy local startTime,time -local maxTile,state +local maxTile,maxNew +local state local fallingTimer local score @@ -38,6 +38,7 @@ local function reset() score=0 time=0 maxTile=2 + maxNew=2 for i=1,5 do for j=1,5 do board[i][j]=rnd(2) end end @@ -89,6 +90,11 @@ local function merge() SFX.play("lock") if chosen==maxTile then maxTile=chosen+1 + maxNew= + maxTile<=4 and 2 or + maxTile<=8 and 3 or + maxTile<=11 and 4 or + 5 SFX.play("reach") end if chosen>=5 then @@ -164,7 +170,11 @@ function scene.update() local noNewTile=true for i=1,5 do if board[1][i]==0 then - board[1][i]=rnd(newTile[maxTile]) + board[1][i]= + maxTile<=4 and rnd(2)or + maxTile<=8 and rnd(3)or + maxTile<=11 and rnd(4)or + rnd(3+rnd(2)) noNewTile=false end end @@ -205,7 +215,7 @@ function scene.draw() for j=1,5 do local N=board[i][j] if N>0 then - if hide and N>newTile[maxTile]then + if hide and N>maxNew then setColor(COLOR.dGrey) rectangle("fill",320+j*128-128,40+i*128-128,128,128) setColor(1,1,1,.3)