Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2013
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. SECONDS_PER_PULSE = 0.75;
  2.  
  3. function GlueButtonMaster_OnUpdate(self, elapsed)
  4. if VX_MUSICTIMER then
  5. if VX_MUSICTIMER < GetTime() then
  6. VX_ONMUSIC = true;
  7. PlayLoginMusic();
  8. end
  9. end
  10.  
  11. if ( _G[self:GetName().."Rays"]:IsShown() ) then
  12. local SECONDS_PER_PULSE = 0.75;
  13. local sign = self.pulseSign;
  14. local counter;
  15.  
  16. if ( self.startPulse ) then
  17. counter = 0;
  18. self.startPulse = true;
  19. sign = 1;
  20. else
  21. counter = self.pulseCounter + (sign * elapsed);
  22. if ( counter > SECONDS_PER_PULSE ) then
  23. counter = SECONDS_PER_PULSE;
  24. sign = -sign;
  25. elseif ( counter < 0) then
  26. counter = 0;
  27. sign = -sign;
  28. end
  29. end
  30.  
  31. local alpha = counter / SECONDS_PER_PULSE;
  32. _G[self:GetName().."Rays"]:SetVertexColor(1.0, 1.0, 1.0, alpha);
  33.  
  34. self.pulseSign = sign;
  35. self.pulseCounter = counter;
  36. end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement