Sha256: b430915aba96f579ab89a99bf270b381da64a40808220608bea596e70787c8fb

Contents?: true

Size: 720 Bytes

Versions: 5

Compression:

Stored size: 720 Bytes

Contents

require_relative 'general_object.rb'

class Pickup < GeneralObject
  POINT_VALUE_BASE = 0
  attr_reader :x, :y

  def initialize(scale, screen_width, screen_height, x = nil, y = nil, options = {})
    super(scale, x, y, screen_width, screen_height, options = {})
    @current_speed = SCROLLING_SPEED * @scale
  end

  def get_draw_ordering
    ZOrder::Pickups
  end

  # Most classes will want to just override this
  def draw
    @image.draw_rot(@x, @y, ZOrder::Pickups, @y, 0.5, 0.5, 1, 1)
  end


  def update mouse_x = nil, mouse_y = nil, player = nil, scroll_factor = 1
    @y += @current_speed * scroll_factor

    super(mouse_x, mouse_y)
  end

  def collected_by_player player
    raise "Override me!"
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
line-em-up-2.0.4 line-em-up/models/pickup.rb
line-em-up-2.0.3 line-em-up/models/pickup.rb
line-em-up-2.0.2 line-em-up/models/pickup.rb
line-em-up-2.0.1 line-em-up/models/pickup.rb
line-em-up-2.0.0 line-em-up/models/pickup.rb