change this more

This commit is contained in:
Jonathan Payne
2012-12-28 17:41:11 -08:00
parent 1d41b4a921
commit f74a2a4707
@@ -2,52 +2,46 @@ local player = Var "Player"
local blinkTime = 1.2 local blinkTime = 1.2
local barWidth = 256; local barWidth = 256;
local barHeight = 32; local barHeight = 32;
local c local c;
local LifeMeter, MaxLives, CurLives;
local function CreateLives(numLives) local LifeRatio;
local t = {};
for i=1,numLives do
t[#t+1] = Def.Quad {
Name=i;
OnCommand=cmd(zoom,1024);
};
end
return t
end
local t = Def.ActorFrame { local t = Def.ActorFrame {
Def.ActorFrame { Def.Quad {
Name="LifeContainer"; Name="LifeFill";
InitCommand=cmd(zoomto,barWidth,barHeight);
--OnCommand=cmd(diffuseramp;effectcolor2,PlayerColor(player);effectcolor1,ColorMidTone(PlayerColor(player));
-- effectclock,'beatnooffset';effectperiod,1);
}; };
InitCommand=function(self) InitCommand=function(self)
c = self:GetChildren(); --c = self:GetChildren();
end; end;
BeginCommand=function(self,param) BeginCommand=function(self,param)
MESSAGEMAN:Broadcast("SystemMessage",{ Message = "TEST", NoAnimate = true}); local screen = SCREENMAN:GetTopScreen() or nil;
local c = self:GetChildren(); if screen ~= nil then
local screen = SCREENMAN:GetTopScreen(); LifeMeter = screen:GetLifeMeter(player);
local lifemeter = screen:GetLifeMeter(player); MaxLives = LifeMeter:GetTotalLives();
MESSAGEMAN:Broadcast("SystemMessage",{ Message = "TEST2", NoAnimate = true}); CurLives = LifeMeter:GetLivesLeft();
local TotalLives = lifemeter:GetTotalLives(); MESSAGEMAN:Broadcast("SystemMessage",
local CurLives = lifemeter:GetLivesLeft(); { Message = "(" .. MaxLives .. ", " .. CurLives ")", NoAnimate = true });
MESSAGEMAN:Broadcast("SystemMessage",{ Message = "ASSIGN CONTAINERS", NoAnimate = true}); else
c.LifeContainer[#c.LifeContainer+1] = CreateLives(TotalLives); MESSAGEMAN:Broadcast("SystemMessage", { Message = "WE DONE FUCKED UP"});
MESSAGEMAN:Broadcast("SystemMessage",{ Message = "LIVES = " .. TotalLives .. " | CUR = " .. CurLives .. " | ACTORS: " .. self:GetNumChildren(), NoAnimate = true}); end
end; end;
LifeChangedMessageCommand=function(self,param) LifeChangedMessageCommand=function(self,param)
if param.Player == player then if param.Player == player then
return LifeRatio = CurLives / MaxLives;
end end
end; end;
StartCommand=function(self,param) StartCommand=function(self,param)
if param.Player == player then if param.Player == player then
return LifeRatio = CurLives / MaxLives;
end end
end; end;
FinishCommand=function(self,param) FinishCommand=function(self,param)
if param.Player == player then if param.Player == player then
return LifeRatio = CurLives / MaxLives;
end end
end; end;
--[[ LoadActor("_lives")..{ --[[ LoadActor("_lives")..{