Use pi constants instead of numbers

This commit is contained in:
Not-A-Normal-Robot
2023-09-21 19:44:55 +07:00
parent bc99af5b1b
commit b1dbc4fa87
10 changed files with 16 additions and 16 deletions

View File

@@ -115,7 +115,7 @@ function scene.draw()
end
elseif state==1 then
gc.setColor(.2,.7,.4,math.min((60-ct)/10,ct/10)*.8)
gc.arc('fill',640,360,260,-1.5708,-1.5708+(ct/60)*6.2832)
gc.arc('fill',640,360,260,math.pi/2,math.pi/2+(ct/60)*MATH.tau)
elseif state==2 and ct<5 then
gc.setColor(1,ct>2 and 1 or 0,0)
gc.rectangle('fill',640-100,(up and 180 or 540)-100,200,200,10)

View File

@@ -135,7 +135,7 @@ function scene.draw()
if M.list then
GC.setColor(1,1,1,t*6)
GC.arc('line','open',0,0,rad+6,0,(M.sel/#M.list)*6.2832)
GC.arc('line','open',0,0,rad+6,0,(M.sel/#M.list)*MATH.tau)
end
GC.pop()
end

View File

@@ -109,7 +109,7 @@ function scene.draw()
-- Fetching timer
if fetchTimer>0 then
gc_setColor(1,1,1,.12)
GC.arc('fill','pie',250,630,40,-1.5708,-1.5708-.6283*fetchTimer)
GC.arc('fill','pie',250,630,40,-math.pi/2,-math.pi/2-.6283*fetchTimer)
end
-- Room list

View File

@@ -85,7 +85,7 @@ function scene.enter()
val[2*i-1],val[2*i]=val[i]*standard[2*i-1],val[i]*standard[2*i]
end
if P1.result=='win' and P1.stat.piece>4 then
if (P1.result=='win' or P1.result=='torikan') and P1.stat.piece>4 then
local acc=P1.stat.finesseRate*.2/P1.stat.piece
rank=CHAR.icon['rank'..(
acc==1. and "Z" or
@@ -294,7 +294,7 @@ function scene.draw()
-- Texts
local C
_=TIME()%6.2832
_=TIME()%MATH.tau
if _>3.142 then
GC.setColor(.97,.97,.97,-timer2*sin(_))
FONT.set(35)

View File

@@ -18,9 +18,9 @@ function scene.draw()
local b=math.floor(t*2)%16+1
gc.setShader(SHADER.blockSatur)
gc.setColor(1,1,1)
mDraw(SKIN.lib[SETTING.skinSet][b],0,0,t%6.2832,2)
mDraw(SKIN.lib[SETTING.skinSet][b],0,0,t%MATH.tau,2)
gc.setColor(1,1,1,t*2%1)
mDraw(SKIN.lib[SETTING.skinSet][b%16+1],0,0,t%6.2832,2)
mDraw(SKIN.lib[SETTING.skinSet][b%16+1],0,0,t%MATH.tau,2)
gc.setShader()
-- Draw center

View File

@@ -17,7 +17,7 @@ function scene.enter()
BG.set()
selRS=RSlist[SETTING.RS]
for i=1,7 do
minoRot0[i]=SETTING.face[i]*1.57
minoRot0[i]=SETTING.face[i]*math.pi/2
minoRot[i]=minoRot0[i]
end
end
@@ -64,7 +64,7 @@ end
local function _nextDir(i)
trySettingWarn()
SETTING.face[i]=(SETTING.face[i]+1)%4
minoRot0[i]=minoRot0[i]+1.5707963
minoRot0[i]=minoRot0[i]+math.pi/2
if not selEggMode and not GAME.playing then
if minoRot0[5]>62 then
selEggMode='marathon_bfmax'
@@ -119,7 +119,7 @@ scene.widgetList={
SETTING.face[i]=0
end
for i=1,7 do
minoRot0[i]=(floor(minoRot0[i]/6.2831853)+(minoRot0[i]%6.2831853>4 and 1 or 0))*6.2831853
minoRot0[i]=(floor(minoRot0[i]/MATH.tau)+(minoRot0[i]%MATH.tau>4 and 1 or 0))*MATH.tau
end
SFX.play('hold')
end},