samples/05_mouse/02_mouse_move/app/main.rb
# Renders flash as a solid. The screen turns white for 10 frames when a zombie is killed.
Renders flash as a solid. The screen turns white for 10 frames when a zombie is killed.
Renders flash as a solid . The screen turns white for 10 frames when a zombie is killed .
def render_flash
    return if state.flash_at.elapsed_time > 10 
    outputs.primitives << [grid.rect, 255, 255, 255, 255 * state.flash_at.ease(10, :flip)].solid
  end
def render_flash return if state . flash_at . elapsed_time > 10 outputs . primitives << [ grid . rect , 255 , 255 , 255 , 255 * state . flash_at . ease ( 10 , :flip ) ] . solid end
Renders flash as a solid.
Renders flash as a solid .
# return if more than 10 frames have passed since flash. # Transparency gradually changes (or eases) during the 10 frames of flash.