游戏开始创建玩家设置初始位置时使用动画

This commit is contained in:
MrZ626
2020-12-11 11:59:10 +08:00
parent b440a900c4
commit eaaaeada51
2 changed files with 30 additions and 16 deletions

View File

@@ -473,32 +473,39 @@ function loadGame(M,ifQuickPlay)--Load a mode and go to game scene
SFX.play("enter")
end
end
function resetPlayerPosition()--Set position & size for every players
function initPlayerPosition()--Set initial position for every player
local L=PLAYERS.alive
L[1]:setPosition(340,75)
for i=1,#L do
L[i]:setPosition(640,-62,0)
end
resetPlayerPosition()
end
function resetPlayerPosition()--Set position & size for every player
local L=PLAYERS.alive
L[1]:movePosition(340,75,1)
if #L<=5 then
if L[2]then L[2]:setPosition(965,390,.5)end
if L[3]then L[3]:setPosition(965,30,.5)end
if L[4]then L[4]:setPosition(20,390,.5)end
if L[5]then L[5]:setPosition(20,30,.5)end
if L[2]then L[2]:movePosition(965,390,.5)end
if L[3]then L[3]:movePosition(965,30,.5)end
if L[4]then L[4]:movePosition(20,390,.5)end
if L[5]then L[5]:movePosition(20,30,.5)end
elseif #L==49 then
local n=2
for i=1,4 do for j=1,6 do
L[n]:setPosition(78*i-54,115*j-98,.09)
L[n]:movePosition(78*i-54,115*j-98,.09)
n=n+1
end end
for i=9,12 do for j=1,6 do
L[n]:setPosition(78*i+267,115*j-98,.09)
L[n]:movePosition(78*i+267,115*j-98,.09)
n=n+1
end end
elseif #L==99 then
local n=2
for i=1,7 do for j=1,7 do
L[n]:setPosition(46*i-36,97*j-72,.068)
L[n]:movePosition(46*i-36,97*j-72,.068)
n=n+1
end end
for i=15,21 do for j=1,7 do
L[n]:setPosition(46*i+264,97*j-72,.068)
L[n]:movePosition(46*i+264,97*j-72,.068)
n=n+1
end end
end
@@ -547,7 +554,7 @@ function resetGameData(replaying)
destroyPlayers()
GAME.curMode.load()
resetPlayerPosition()
initPlayerPosition()
restoreVirtualKey()
if GAME.modeEnv.task then
for i=1,#PLAYERS do