local t = Def.ActorFrame {};

t[#t+1] = Def.ActorFrame {
	    LoadActor("p1life") .. { 
		InitCommand=cmd(horizalign,left;y,SCREEN_TOP-30;x,SCREEN_LEFT+10;visible,GAMESTATE:IsPlayerEnabled(PLAYER_1));
		OnCommand=cmd(sleep,0.4;decelerate,0.3;addy,70;smooth,0.2;addy,-10);
		OffCommand=cmd(sleep,2.0;smooth,0.3;addy,-70);
    };
}; 

t[#t+1] = Def.ActorFrame {
	    LoadActor("p2life") .. { 
		InitCommand=cmd(horizalign,left;y,SCREEN_TOP-30;x,SCREEN_RIGHT-10;visible,GAMESTATE:IsPlayerEnabled(PLAYER_2);zoomx,-1;);
		OnCommand=cmd(sleep,0.4;decelerate,0.3;addy,70;smooth,0.2;addy,-10);
		OffCommand=cmd(sleep,2.0;smooth,0.3;addy,-70);
    };
}; 	
		
t[#t+1] = Def.ActorFrame {
	    LoadActor("_ohnoes") .. { 
		InitCommand=cmd(horizalign,left;y,SCREEN_TOP+30;x,SCREEN_LEFT+10;visible,GAMESTATE:IsPlayerEnabled(PLAYER_1);diffusealpha,0);
		HealthStateChangedMessageCommand=function(self,params)
			if(params.PlayerNumber == PLAYER_1) then
				if(params.HealthState == 'HealthState_Danger') then
					self:diffusealpha(1.0);
				else
					self:diffusealpha(0.0);
				end;
			end;
		end;
	};
};

t[#t+1] = Def.ActorFrame {
	    LoadActor("_ohnoes") .. { 
		InitCommand=cmd(horizalign,left;y,SCREEN_TOP-30;x,SCREEN_RIGHT-10;visible,GAMESTATE:IsPlayerEnabled(PLAYER_2);diffusealpha,0);
		HealthStateChangedMessageCommand=function(self,params)
			if(params.PlayerNumber == PLAYER_2) then
				if(params.HealthState == 'HealthState_Danger') then
					self:diffusealpha(1.0);
				else
					self:diffusealpha(0.0);
				end;
			end;
		end;
	};
};

return t;