Load the actor for the current stage only and only show Event Mode during Regular play.

This commit is contained in:
Steve Checkoway
2009-03-25 08:03:46 +00:00
parent ed7a89657e
commit 96650cc156
@@ -1,21 +1,18 @@
local t = Def.ActorFrame {};
local InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;);
t[#t+1] = LoadActor("horizon") .. {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;);
InitCommand=InitCommand;
};
t[#t+1] = LoadActor("sun") .. {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;);
InitCommand=InitCommand;
};
local pm = GAMESTATE:GetPlayMode();
-- This relies on play modes and stages having the same naming for
-- everything but Regular.
local stage = pm == 'PlayMode_Regular' and GAMESTATE:GetCurrentStage() or
'Stage_' .. string.sub(pm, 10);
t[#t+1] = LoadActor( stage ) .. {
InitCommand=InitCommand;
OnCommand=cmd(cropbottom,1;linear,0.5;cropbottom,0;sleep,10;);
};
local InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;);
local OnCommand=cmd(cropbottom,1;linear,0.5;cropbottom,0;sleep,10;);
local function AddChild( i )
t[#t+1] = LoadActor( i ) .. {
InitCommand=InitCommand;
OnCommand=OnCommand;
Condition=GAMESTATE:GetCurrentStage() == i;
};
end
for i in ivalues(Stage) do
AddChild( i );
end
return t;