lib/gamebox/actors/curtain.rb
# Update curtain height 0-255 (alpha)
Update curtain height 0-255 (alpha)
Update curtain height 0 - 255 ( alpha )
def update(time)
      perc_change = time.to_f/actor.duration_in_ms
      amount = FULL_CURTAIN * perc_change * actor.dir
      actor.height += amount.floor
      if actor.height < 0
        actor.height = 0
        if actor.alive
          actor.emit :curtain_up
          actor.remove
        end
      elsif actor.height > 255
        actor.height = 255
        if actor.alive
          actor.emit :curtain_down
          actor.remove
        end
      end
    end
def update ( time ) perc_change = time . to_f / actor . duration_in_ms amount = FULL_CURTAIN * perc_change * actor . dir actor . height += amount . floor if actor . height < 0 actor . height = 0 if actor . alive actor . emit :curtain_up actor . remove end elsif actor . height > 255 actor . height = 255 if actor . alive actor . emit :curtain_down actor . remove end end end
Update curtain height 0-255 (alpha)
Update curtain height 0 - 255 ( alpha )
time
<not_specific>