Use pi constants instead of numbers
This commit is contained in:
@@ -19,9 +19,9 @@ function back.update()
|
|||||||
t=t-1
|
t=t-1
|
||||||
if t==0 then
|
if t==0 then
|
||||||
local S={
|
local S={
|
||||||
ang=6.2832*rnd(),
|
ang=MATH.tau*rnd(),
|
||||||
d=SCR.rad*1.05/2,
|
d=SCR.rad*1.05/2,
|
||||||
rotate=6.2832*rnd(),
|
rotate=MATH.tau*rnd(),
|
||||||
va=.05-rnd()*.1,
|
va=.05-rnd()*.1,
|
||||||
size=SCR.rad*(2+rnd()*3)/100,
|
size=SCR.rad*(2+rnd()*3)/100,
|
||||||
texture=SKIN.lib[SETTING.skinSet][rnd(16)],
|
texture=SKIN.lib[SETTING.skinSet][rnd(16)],
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function back.update()
|
|||||||
x=SCR.w*rnd(),
|
x=SCR.w*rnd(),
|
||||||
y=SCR.h*-.05,
|
y=SCR.h*-.05,
|
||||||
k=SCR.rad/200,
|
k=SCR.rad/200,
|
||||||
ang=rnd()*6.2832,
|
ang=rnd()*MATH.tau,
|
||||||
vy=.5+rnd()*.4,
|
vy=.5+rnd()*.4,
|
||||||
vx=rnd()*.4-.2,
|
vx=rnd()*.4-.2,
|
||||||
va=rnd()*.04-.02,
|
va=rnd()*.04-.02,
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ function back.update()
|
|||||||
ins(mino,{
|
ins(mino,{
|
||||||
block=TEXTURE.miniBlock[r],
|
block=TEXTURE.miniBlock[r],
|
||||||
color=BLOCK_COLORS[SETTING.skin[r]],
|
color=BLOCK_COLORS[SETTING.skin[r]],
|
||||||
ang=6.2832*rnd(),
|
ang=MATH.tau*rnd(),
|
||||||
rotate=6.2832*rnd(),
|
rotate=MATH.tau*rnd(),
|
||||||
vr=.05-rnd()*.1,
|
vr=.05-rnd()*.1,
|
||||||
d=0,
|
d=0,
|
||||||
v=.5+rnd(),
|
v=.5+rnd(),
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ function NETPLY.add(d)
|
|||||||
place=1e99,
|
place=1e99,
|
||||||
stat=false,
|
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
|
p.x,p.y,p.w,p.h=640+2600*math.cos(a),360+2600*math.sin(a),47,47
|
||||||
|
|
||||||
ins(PLYlist,p)
|
ins(PLYlist,p)
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
elseif state==1 then
|
elseif state==1 then
|
||||||
gc.setColor(.2,.7,.4,math.min((60-ct)/10,ct/10)*.8)
|
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
|
elseif state==2 and ct<5 then
|
||||||
gc.setColor(1,ct>2 and 1 or 0,0)
|
gc.setColor(1,ct>2 and 1 or 0,0)
|
||||||
gc.rectangle('fill',640-100,(up and 180 or 540)-100,200,200,10)
|
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
|
if M.list then
|
||||||
GC.setColor(1,1,1,t*6)
|
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
|
end
|
||||||
GC.pop()
|
GC.pop()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ function scene.draw()
|
|||||||
-- Fetching timer
|
-- Fetching timer
|
||||||
if fetchTimer>0 then
|
if fetchTimer>0 then
|
||||||
gc_setColor(1,1,1,.12)
|
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
|
end
|
||||||
|
|
||||||
-- Room list
|
-- 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]
|
val[2*i-1],val[2*i]=val[i]*standard[2*i-1],val[i]*standard[2*i]
|
||||||
end
|
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
|
local acc=P1.stat.finesseRate*.2/P1.stat.piece
|
||||||
rank=CHAR.icon['rank'..(
|
rank=CHAR.icon['rank'..(
|
||||||
acc==1. and "Z" or
|
acc==1. and "Z" or
|
||||||
@@ -294,7 +294,7 @@ function scene.draw()
|
|||||||
|
|
||||||
-- Texts
|
-- Texts
|
||||||
local C
|
local C
|
||||||
_=TIME()%6.2832
|
_=TIME()%MATH.tau
|
||||||
if _>3.142 then
|
if _>3.142 then
|
||||||
GC.setColor(.97,.97,.97,-timer2*sin(_))
|
GC.setColor(.97,.97,.97,-timer2*sin(_))
|
||||||
FONT.set(35)
|
FONT.set(35)
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ function scene.draw()
|
|||||||
local b=math.floor(t*2)%16+1
|
local b=math.floor(t*2)%16+1
|
||||||
gc.setShader(SHADER.blockSatur)
|
gc.setShader(SHADER.blockSatur)
|
||||||
gc.setColor(1,1,1)
|
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)
|
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()
|
gc.setShader()
|
||||||
|
|
||||||
-- Draw center
|
-- Draw center
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function scene.enter()
|
|||||||
BG.set()
|
BG.set()
|
||||||
selRS=RSlist[SETTING.RS]
|
selRS=RSlist[SETTING.RS]
|
||||||
for i=1,7 do
|
for i=1,7 do
|
||||||
minoRot0[i]=SETTING.face[i]*1.57
|
minoRot0[i]=SETTING.face[i]*math.pi/2
|
||||||
minoRot[i]=minoRot0[i]
|
minoRot[i]=minoRot0[i]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -64,7 +64,7 @@ end
|
|||||||
local function _nextDir(i)
|
local function _nextDir(i)
|
||||||
trySettingWarn()
|
trySettingWarn()
|
||||||
SETTING.face[i]=(SETTING.face[i]+1)%4
|
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 not selEggMode and not GAME.playing then
|
||||||
if minoRot0[5]>62 then
|
if minoRot0[5]>62 then
|
||||||
selEggMode='marathon_bfmax'
|
selEggMode='marathon_bfmax'
|
||||||
@@ -119,7 +119,7 @@ scene.widgetList={
|
|||||||
SETTING.face[i]=0
|
SETTING.face[i]=0
|
||||||
end
|
end
|
||||||
for i=1,7 do
|
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
|
end
|
||||||
SFX.play('hold')
|
SFX.play('hold')
|
||||||
end},
|
end},
|
||||||
|
|||||||
Reference in New Issue
Block a user