新增显示落块分数

This commit is contained in:
MrZ626
2020-09-22 22:58:22 +08:00
parent 39e35a8cd6
commit 868abe1396
7 changed files with 69 additions and 25 deletions

View File

@@ -285,6 +285,7 @@ local langList={
setting_game={
graphic="←画面设置",
sound="声音设置→",
ctrl="控制设置",
key="键位设置",
touch="触屏设置",
@@ -301,12 +302,15 @@ local langList={
setting_video={
sound="←声音设置",
game="游戏设置→",
block="方块可见",
ghost="阴影透明度",
center="旋转中心透明度",
smooth="平滑下落",
grid="网格",
bagLine="包分界线",
lockFX="锁定特效等级",
dropFX="下落特效等级",
moveFX="移动特效等级",
@@ -314,7 +318,9 @@ local langList={
shakeFX="晃动特效等级",
atkFX="攻击特效等级",
frame="绘制帧率",
text="消行文本",
score="分数动画",
warn="死亡预警",
highCam="超屏视野",
nextPos="生成预览",
@@ -326,6 +332,7 @@ local langList={
setting_sound={
game="←游戏设置",
graphic="画面设置→",
sfx="音效",
stereo="立体声",
spawn="方块生成",
@@ -802,6 +809,7 @@ local langList={
setting_game={
graphic="←画面设置",
sound="声音设置→",
ctrl="控制设置",
key="键位设置",
touch="触屏设置",
@@ -818,12 +826,15 @@ local langList={
setting_video={
sound="←声音设置",
game="游戏设置→",
block="方块可见",
ghost="阴影透明度",
center="旋转中心透明度",
smooth="平滑下落",
grid="网格",
bagLine="包分界线",
lockFX="锁定特效等级",
dropFX="下落特效等级",
moveFX="移动特效等级",
@@ -831,7 +842,9 @@ local langList={
shakeFX="晃动特效等级",
atkFX="攻击特效等级",
frame="绘制帧率",
text="消行文本",
score="分数动画",
warn="死亡预警",
highCam="超屏视野",
nextPos="生成预览",
@@ -843,6 +856,7 @@ local langList={
setting_sound={
game="←游戏设置",
graphic="画面设置→",
sfx="音效",
stereo="立体声",
spawn="方块生成",
@@ -1309,6 +1323,7 @@ local langList={
setting_game={
graphic="←Video",
sound="Sound→",
ctrl="Control Settings",
key="Key Mappings",
touch="Touch Settings",
@@ -1325,12 +1340,15 @@ local langList={
setting_video={
sound="←Sound",
game="Game→",
block="Draw Block",
ghost="Ghost",
center="Center",
smooth="Smooth drop",
grid="Grid",
bagLine="Bag Line",
lockFX="Lock FX Level",
dropFX="Drop FX Level",
moveFX="Move FX Level",
@@ -1338,7 +1356,9 @@ local langList={
shakeFX="Field Sway Level",
atkFX="ATK. FX Level",
frame="Render Frame Rate",
text="Action Text",
score="Pop-up Score",
warn="Death Alert",
highCam="Bird-eye view",
nextPos="Next preview",
@@ -1350,6 +1370,7 @@ local langList={
setting_sound={
game="←Game",
graphic="Video→",
sfx="SFX",
stereo="Stereo",
spawn="Spawning",
@@ -1812,6 +1833,7 @@ local langList={
setting_game={
graphic="←Video",
sound="Sound→",
ctrl="=?=",
key="=?",
touch="_?",
@@ -1828,12 +1850,15 @@ local langList={
setting_video={
sound="←Sound",
game="Game→",
block="==↓==",
ghost="__↓__",
center="+",
smooth="~~↓~~",
grid="#",
bagLine="123|123",
lockFX="↓_~",
dropFX="↓~",
moveFX="←→~",
@@ -1841,7 +1866,9 @@ local langList={
shakeFX="~|~|~",
atkFX="→→~",
frame="|=|",
text="ABC",
score="+123",
warn="!↑↑↑!",
highCam="↑__↑",
nextPos="???←",
@@ -1853,6 +1880,7 @@ local langList={
setting_sound={
game="←Game",
graphic="Video→",
sfx="#!#",
stereo="←~→",
spawn="#[]#",
@@ -2327,6 +2355,7 @@ local langList={
setting_game={
graphic="←改画面",
sound="改声音→",
ctrl="改控制",
key="改键位",
touch="改触屏",
@@ -2343,12 +2372,15 @@ local langList={
setting_video={
sound="←改声音",
game="游戏设置→",
block="方块可见",
ghost="阴影",
smooth="平滑下落",
center="中心",
grid="网格",
bagLine="包分界线",
lockFX="锁定特效",
dropFX="下落特效",
moveFX="移动特效",
@@ -2356,7 +2388,9 @@ local langList={
shakeFX="晃动特效",
atkFX="攻击特效",
frame="绘制帧率",
text="招式名",
score="跳分",
warn="死亡预警",
highCam="拉镜",
nextPos="生成预览",
@@ -2368,6 +2402,7 @@ local langList={
setting_sound={
game="←游戏设置",
graphic="改画面→",
sfx="音效",
stereo="立体声",
spawn="出块",

View File

@@ -64,10 +64,10 @@ function textFX.beat(t)
mStr(t.text,0,-t.font*.7)
gc.pop()
end
function textFX.mark(t)
function textFX.score(t)
local _,_,_,T=gc.getColor()
gc.setColor(1,1,1,T*.08)
mStr(t.text,t.x,t.y-t.font*.7)
gc.setColor(1,1,1,T*.5)
mStr(t.text,t.x,t.y-t.font*.7-t.c^.3*50)
end
local TEXT={}

View File

@@ -394,22 +394,23 @@ local Widgets={
end}),
newSwitch({name="text", x=1100, y=180,font=35,disp=SETval("text"),code=SETrev("text")}),
newSwitch({name="warn", x=1100, y=240,font=35,disp=SETval("warn"),code=SETrev("warn")}),
newSwitch({name="highCam", x=1100, y=300,font=35,disp=SETval("highCam"),code=SETrev("highCam")}),
newSwitch({name="nextPos", x=1100, y=360,font=35,disp=SETval("nextPos"),code=SETrev("nextPos")}),
newSwitch({name="fullscreen",x=1100,y=420,font=35,disp=SETval("fullscreen"),
newSwitch({name="score", x=1100, y=240,font=35,disp=SETval("score"),code=SETrev("score")}),
newSwitch({name="warn", x=1100, y=300,font=35,disp=SETval("warn"),code=SETrev("warn")}),
newSwitch({name="highCam", x=1100, y=360,font=35,disp=SETval("highCam"),code=SETrev("highCam")}),
newSwitch({name="nextPos", x=1100, y=420,font=35,disp=SETval("nextPos"),code=SETrev("nextPos")}),
newSwitch({name="fullscreen",x=1100,y=480,font=30,disp=SETval("fullscreen"),
code=function()
setting.fullscreen=not setting.fullscreen
love.window.setFullscreen(setting.fullscreen)
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
end}),
newSwitch({name="bg", x=1100, y=480,font=35,disp=SETval("bg"),
newSwitch({name="bg", x=1100, y=540,font=35,disp=SETval("bg"),
code=function()
BG.set("none")
setting.bg=not setting.bg
BG.set("space")
end}),
newSwitch({name="power", x=1100, y=540,font=35,disp=SETval("powerInfo"),
newSwitch({name="power", x=990, y=640,font=35,disp=SETval("powerInfo"),
code=function()
setting.powerInfo=not setting.powerInfo
end}),

View File

@@ -5,7 +5,6 @@ return{
env={
drop=15,lock=45,
fall=10,
center=false,
dropFX=0,lockFX=0,
visible="none",
dropPiece=PLY.check_lineReach,

View File

@@ -5,7 +5,7 @@ return{
env={
drop=10,lock=60,
fall=5,
center=0,ghost=0,
ghost=0,
dropFX=0,lockFX=0,
visible="none",
dropPiece=PLY.check_lineReach,

View File

@@ -29,6 +29,7 @@ setting={
frameMul=100,
text=true,
score=true,
warn=true,
highCam=false,
nextPos=false,

View File

@@ -2,7 +2,7 @@ local gc=love.graphics
local mt=love.math
local Timer=love.timer.getTime
local int,ceil,rnd=math.floor,math.ceil,math.random
local max,min,abs,sin,cos=math.max,math.min,math.abs,math.sin,math.cos
local max,min,abs,sin,cos,log=math.max,math.min,math.abs,math.sin,math.cos,math.log
local ins,rem=table.insert,table.remove
local format=string.format
local scr=scr
@@ -18,6 +18,7 @@ local gameEnv0={
smooth=false,grid=false,
bagLine=false,
text=true,
score=true,
lockFX=2,
dropFX=2,
moveFX=2,
@@ -2097,9 +2098,11 @@ do--player.drop(P)--Place piece
local _
local CHN=VOC.getFreeChannel()
P.dropTime[11]=ins(P.dropTime,1,game.frame)--Update speed dial
local cmb=P.combo
P.waiting=P.gameEnv.wait
local ENV=P.gameEnv
local STAT=P.stat
P.waiting=ENV.wait
local cmb=P.combo
local CB,CX,CY=P.cur,P.curX,P.curY
local clear--If (perfect)clear
local cc,gbcc=0,0--Row/garbage-row cleared,full-part
@@ -2145,15 +2148,15 @@ do--player.drop(P)--Place piece
end
--Create clearing FX
if cc>0 and P.gameEnv.clearFX then
local t=7-P.gameEnv.clearFX*1
if cc>0 and ENV.clearFX then
local t=7-ENV.clearFX*1
for i=1,cc do
P:createClearingFX(P.clearedRow[i],t)
end
end
--Create locking FX
if P.gameEnv.lockFX then
if ENV.lockFX then
if cc==0 then
P:createLockFX()
else
@@ -2234,7 +2237,7 @@ do--player.drop(P)--Place piece
_=_-1
end
if P.clearingRow[1]then
P.falling=P.gameEnv.fall
P.falling=ENV.fall
elseif cc==P.r then
clear=true
end
@@ -2285,7 +2288,7 @@ do--player.drop(P)--Place piece
P:showText(text.mini,0,-80,35,"appear")
atk=atk*.25
sendTime=sendTime+60
cscore=cscore*.6
cscore=cscore*.5
P.b2b=P.b2b+b2bPoint[cc]*.5
if P.human then
VOC.play("mini",CHN)
@@ -2445,7 +2448,7 @@ do--player.drop(P)--Place piece
--Check clearing task
if P.curMission then
local t=P.gameEnv.mission[P.curMission]
local t=ENV.mission[P.curMission]
local success
if t<5 then
if C.row==t then
@@ -2467,11 +2470,11 @@ do--player.drop(P)--Place piece
if success then
P.curMission=P.curMission+1
SFX.play("reach")
if P.curMission>#P.gameEnv.mission then
if P.curMission>#ENV.mission then
P.curMission=nil
P:win()
end
elseif P.gameEnv.missionKill then
elseif ENV.missionKill then
P:showText(text.missionFailed,0,140,40,"flicker",.5)
SFX.play("finesseError_long",.6)
P:lose()
@@ -2503,7 +2506,7 @@ do--player.drop(P)--Place piece
--DropSpeed bonus
if P._20G then
dropScore=dropScore*2
elseif P.gameEnv.drop<3 then
elseif ENV.drop<3 then
dropScore=dropScore*1.5
end
@@ -2524,7 +2527,11 @@ do--player.drop(P)--Place piece
end
P.combo=cmb
STAT.score=STAT.score+int(cscore)
cscore=int(cscore)
if ENV.score then
P:showText(cscore,(P.curX+P.sc[2]-5.5)*30,(10-P.curY-P.sc[1])*30+P.fieldBeneath+P.fieldUp,int(40-600/(cscore+20)),"score",2)
end
STAT.score=STAT.score+cscore
STAT.piece=STAT.piece+1
STAT.row=STAT.row+cc
if atk>0 then
@@ -2552,7 +2559,7 @@ do--player.drop(P)--Place piece
end
--Drop event
_=P.gameEnv.dropPiece
_=ENV.dropPiece
if _ then _(P)end
--Stereo SFX
@@ -3083,6 +3090,7 @@ function PLY.newDemoPlayer(id,x,y,size)
smooth=setting.smooth,
grid=setting.grid,
text=setting.text,
score=setting.score,
lockFX=setting.lockFX,
dropFX=setting.dropFX,
moveFX=setting.moveFX,