pawker/app/scenes/lives.rb
# TODO: If losing a life, have a bug come in and carry off the last icon
# TODO: If gaining a life, have a bug come in and drop off the last icon
# TODO: Have a dithered light green background slide in from both sides
If losing a life, have a bug come in and carry off the last icon
TODO: If gaining a life, have a bug come in and drop off the last icon
TODO: Have a dithered light green background slide in from both sides
If losing a life have a bug come in and carry off the last icon TODO : If gaining a life have a bug come in and drop off the last icon TODO : Have a dithered light green background slide in from both sides
def tick(args)
      if @complete_timer
        if @complete_timer.complete?(args)
          advance_phase!
        end
      elsif @wrap_up_timer&.complete?(args) || (ticks_elapsed > 30 && args.inputs.keyboard.space)
        @wrap_up_timer = nil
        @complete_timer = Ease.new(ticks: 60)
        @paws.reverse.each_with_index do |paw, i|
          paw.ease_y = Ease.new(from: paw.y, to: -17 , mode: :in_back, ticks: 30, defer: 3 * i)
        end
        if @text
          @text.ease_x = Ease.new(from: @text.x, to: NOKIA_WIDTH , ticks: 30)
        end
        if @bonus_card
          @bonus_card.ease_x = Ease.new(from: @bonus_card.x, to: -1 * @bonus_card.w, ticks: 30)
        end
        if direction == :gain
          Progression.next_round(args, defer: 40)
        else
          if args.state.lives == 0
          else
            Progression.repeat_round(args, defer: 40)
          end
        end
      end
      if @sound_timer&.complete?(args)
        args.outputs.sounds << @sound_path
        @sound_timer = nil
      end
      if @direction == :lose
        if ticks_elapsed == 60
          @cross = Sprite.new(x: @paws.last.x, y: 0, w: 17, h: 17, path: "sprites/paw-print-cross.png")
          @paws.last.ease_y = Ease.new(from: @paws.last.y, to: -17, ticks: 60)
          @paws.last.ease_angle = Ease.new(from: 0, to: -45, ticks: 60, defer: 10)
        elsif ticks_elapsed > 90
          @cross = nil
        end
      end
      @paws.each { |paw| paw.tick(args) }
      @cross&.tick(args)
      @text&.tick(args)
      @bonus_card&.tick(args)
    end
def tick ( args ) if @complete_timer if @complete_timer . complete? ( args ) advance_phase! end elsif @wrap_up_timer &. complete? ( args ) || ( ticks_elapsed > 30 && args . inputs . keyboard . space ) @wrap_up_timer = nil @complete_timer = Ease . new ( ticks : 60 ) @paws . reverse . each_with_index do | paw , i | paw . ease_y = Ease . new ( from : paw . y , to : - 17 , mode : :in_back , ticks : 30 , defer : 3 * i ) end if @text @text . ease_x = Ease . new ( from : @text . x , to : NOKIA_WIDTH , ticks : 30 ) end if @bonus_card @bonus_card . ease_x = Ease . new ( from : @bonus_card . x , to : - 1 * @bonus_card . w , ticks : 30 ) end if direction == :gain Progression . next_round ( args , defer : 40 ) else if args . state . lives == 0 else Progression . repeat_round ( args , defer : 40 ) end end end if @sound_timer &. complete? ( args ) args . outputs . sounds << @sound_path @sound_timer = nil end if @direction == :lose if ticks_elapsed == 60 @cross = Sprite . new ( x : @paws . last . x , y : 0 , w : 17 , h : 17 , path : "sprites/paw-print-cross.png" ) @paws . last . ease_y = Ease . new ( from : @paws . last . y , to : - 17 , ticks : 60 ) @paws . last . ease_angle = Ease . new ( from : 0 , to : - 45 , ticks : 60 , defer : 10 ) elsif ticks_elapsed > 90 @cross = nil end end @paws . each { | paw | paw . tick ( args ) } @cross &. tick ( args ) @text &. tick ( args ) @bonus_card &. tick ( args ) end
TODO: If losing a life, have a bug come in and carry off the last icon
TODO: If gaining a life, have a bug come in and drop off the last icon
TODO: Have a dithered light green background slide in from both sides
TODO : If losing a life have a bug come in and carry off the last icon TODO : If gaining a life have a bug come in and drop off the last icon TODO : Have a dithered light green background slide in from both sides
# Start the wrap up procedure # Where to next? # Progression.game_over(args, defer: 40)
args