Method: WSLight::Set::StarSet#generate_frame

Defined in:
lib/ws_light/set/star_set.rb

#generate_frameObject



29
30
31
32
33
34
35
36
37
# File 'lib/ws_light/set/star_set.rb', line 29

def generate_frame
  @set = []
  @full_length.times { @set << BLACK }
  start = (@frame_count * VISIBLE_STARS / FRAMES_PER_STAR) % @max
  VISIBLE_STARS.times do |i|
    star_ratio = FRAMES_PER_STAR.to_f / VISIBLE_STARS.to_f
    draw_star(@stars[start + i], @frame_count - ((start - VISIBLE_STARS + 1 + i) * star_ratio).to_i)
  end
end