Use pi constants instead of numbers
This commit is contained in:
@@ -19,9 +19,9 @@ function back.update()
|
||||
t=t-1
|
||||
if t==0 then
|
||||
local S={
|
||||
ang=6.2832*rnd(),
|
||||
ang=MATH.tau*rnd(),
|
||||
d=SCR.rad*1.05/2,
|
||||
rotate=6.2832*rnd(),
|
||||
rotate=MATH.tau*rnd(),
|
||||
va=.05-rnd()*.1,
|
||||
size=SCR.rad*(2+rnd()*3)/100,
|
||||
texture=SKIN.lib[SETTING.skinSet][rnd(16)],
|
||||
|
||||
@@ -21,7 +21,7 @@ function back.update()
|
||||
x=SCR.w*rnd(),
|
||||
y=SCR.h*-.05,
|
||||
k=SCR.rad/200,
|
||||
ang=rnd()*6.2832,
|
||||
ang=rnd()*MATH.tau,
|
||||
vy=.5+rnd()*.4,
|
||||
vx=rnd()*.4-.2,
|
||||
va=rnd()*.04-.02,
|
||||
|
||||
@@ -21,8 +21,8 @@ function back.update()
|
||||
ins(mino,{
|
||||
block=TEXTURE.miniBlock[r],
|
||||
color=BLOCK_COLORS[SETTING.skin[r]],
|
||||
ang=6.2832*rnd(),
|
||||
rotate=6.2832*rnd(),
|
||||
ang=MATH.tau*rnd(),
|
||||
rotate=MATH.tau*rnd(),
|
||||
vr=.05-rnd()*.1,
|
||||
d=0,
|
||||
v=.5+rnd(),
|
||||
|
||||
@@ -121,7 +121,7 @@ function NETPLY.add(d)
|
||||
place=1e99,
|
||||
stat=false,
|
||||
}
|
||||
local a=math.random()*6.2832
|
||||
local a=math.random()*MATH.tau
|
||||
p.x,p.y,p.w,p.h=640+2600*math.cos(a),360+2600*math.sin(a),47,47
|
||||
|
||||
ins(PLYlist,p)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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},
|
||||
|
||||
Reference in New Issue
Block a user