[LifeMeterBattery] Added LostLife param to LifeChanged message. Converted LifeMeterBattery lives to an AutoActor.

This commit is contained in:
AJ Kelly
2011-08-07 01:05:43 -05:00
parent 894caccc0f
commit d413a0044d
6 changed files with 45 additions and 45 deletions

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

@@ -0,0 +1,20 @@
local player = Var "Player"
local blinkTime = 1.2
local t = Def.ActorFrame{
LoadActor("_lives")..{
-- xxx: assumes course is 4lives
InitCommand=cmd(pause;setstate,3);
LifeChangedMessageCommand=function(self,param)
if param.Player == player then
if param.LivesLeft <= 4 then
self:setstate( math.max(param.LivesLeft-1,0) )
else
self:setstate(3)
end
end
end;
};
};
return t;