Skip to content

Commit

Permalink
Pads should be nicer I hope
Browse files Browse the repository at this point in the history
  • Loading branch information
tertu-m committed Feb 1, 2016
1 parent 08b0873 commit 0c4f3d8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
local masterPlayer = GAMESTATE:GetMasterPlayerNumber() == PLAYER_1 and "P1" or "P2"
local unjoinedPlayer = GAMESTATE:GetMasterPlayerNumber() == PLAYER_1 and "P2" or "P1"
local masterPlayer = ToEnumShortString(GAMESTATE:GetMasterPlayerNumber())

local t = Def.ActorFrame{
-- Information panel
LoadActor("_info")..{
InitCommand=cmd(halign,1;x,SCREEN_RIGHT+11;y,SCREEN_CENTER_Y-75;);
GainFocusCommand=cmd(visible,true;addx,-11;decelerate,0.1;addx,11);
GainFocusCommand=function(s) MESSAGEMAN:Broadcast("PadsTwo") s:visible(true):addx(-11):decelerate(0.1):addx(11) end;
LoseFocusCommand=cmd(visible,false);
OffCommand=cmd(decelerate,0.264;addx,(SCREEN_WIDTH)+440);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
local masterPlayer = GAMESTATE:GetMasterPlayerNumber() == PLAYER_1 and "P1" or "P2"
local unjoinedPlayer = GAMESTATE:GetMasterPlayerNumber() == PLAYER_1 and "P2" or "P1"
local masterPlayer = ToEnumShortString(GAMESTATE:GetMasterPlayerNumber())

local t = Def.ActorFrame{
-- Information panel
LoadActor("_info")..{
InitCommand=cmd(halign,1;x,SCREEN_RIGHT+11;y,SCREEN_CENTER_Y-75;);
OnCommand=cmd(addx,379;sleep,0.264;decelerate,0.264;addx,-379;decelerate,0.1;addx,11);
GainFocusCommand=cmd(visible,true;addx,-11;decelerate,0.1;addx,11);
OnCommand=function(s) s:addx(379):sleep(0.264):decelerate(0.264):addx(-379):decelerate(0.1):addx(11) end;
GainFocusCommand=function(s) MESSAGEMAN:Broadcast("PadsOne") s:visible(true):addx(-11):decelerate(0.1):addx(11) end;
LoseFocusCommand=cmd(visible,false);
OffCommand=cmd(decelerate,0.264;addx,(SCREEN_WIDTH)+440);
};

-- Panel
LoadActor("_panel2.png")..{
LoadActor("_panel2")..{
InitCommand=cmd(x,SCREEN_CENTER_X-402;y,SCREEN_CENTER_Y+32);
GainFocusCommand=cmd(linear,0.1;addx,-225;addy,-49);
LoseFocusCommand=cmd(linear,0.1;addx,225;addy,49);
OnCommand=cmd(zoom,0;diffusealpha,0;sleep,0.264;sleep,0.792;sleep,0.132;diffusealpha,1;decelerate,0.066;zoom,1;accelerate,0.066;zoom,0.8;decelerate,0.066;zoom,1);
PadsOneMessageCommand=function(s) s:linear(0.1):x(SCREEN_CENTER_X-627):y(SCREEN_CENTER_Y-17) lastPad2=1 end;
PadsTwoMessageCommand=function(s) s:linear(0.1):x(SCREEN_CENTER_X-207):y(SCREEN_CENTER_Y+71) lastPad2=2 end;
OffCommand=cmd(sleep,0.264;accelerate,0.066;zoom,0.8;decelerate,0.066;zoom,1;accelerate,0.066;zoom,0);
};
LoadActor("_panel (doubleres)")..{
InitCommand=cmd(x,SCREEN_CENTER_X-112;y,SCREEN_CENTER_Y+119;);
OnCommand=cmd(zoom,0;diffusealpha,0;sleep,0.264;sleep,0.792;sleep,0.132;diffusealpha,1;decelerate,0.066;zoom,1;accelerate,0.066;zoom,0.8;decelerate,0.066;zoom,1);
GainFocusCommand=cmd(linear,0.1;addx,-30;addy,-10);
LoseFocusCommand=cmd(linear,0.1;addx,30;addy,10);
PadsOneMessageCommand=function(s) s:linear(0.1):x(SCREEN_CENTER_X-142):y(SCREEN_CENTER_Y+109) end;
PadsTwoMessageCommand=function(s) s:linear(0.1):x(SCREEN_CENTER_X-112):y(SCREEN_CENTER_Y+119) end;
OffCommand=cmd(sleep,0.264;accelerate,0.066;zoom,0.8;decelerate,0.066;zoom,1;accelerate,0.066;zoom,0);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local t = Def.ActorFrame{
-- Information panel
LoadActor("_info")..{
InitCommand=cmd(halign,1;x,SCREEN_RIGHT+11;y,SCREEN_CENTER_Y-75;);
GainFocusCommand=cmd(visible,true;addx,-11;decelerate,0.1;addx,11);
GainFocusCommand=function(s) MESSAGEMAN:Broadcast("PadsTwo") s:visible(true):addx(-11):decelerate(0.1):addx(11) end;
LoseFocusCommand=cmd(visible,false);
OffCommand=cmd(decelerate,0.264;addx,(SCREEN_WIDTH)+440);
};
Expand Down

0 comments on commit 0c4f3d8

Please sign in to comment.