Sha256: e98a7675ad7b7757bcfb005c926e08f42dfa3c82bbbb4331e77654129ea64cc5

Contents?: true

Size: 872 Bytes

Versions: 1

Compression:

Stored size: 872 Bytes

Contents

require_relative 'general_object.rb'

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

  def initialize(scale, x = nil, y = nil)
    @scale = scale
    @image = get_image
    @x = x
    @y = y
    @time_alive = 0
    @image_width  = @image.width  * @scale
    @image_height = @image.height * @scale
    @image_size   = @image_width  * @image_height / 2
    @image_radius = (@image_width  + @image_height) / 4
    @current_speed = SCROLLING_SPEED * @scale
  end

  def get_draw_ordering
    ZOrder::Pickups
  end

  # def draw
  #   # @image.draw_rot(@x, @y, ZOrder::Pickups, @y, 0.5, 0.5, 1, 1)
  #   raise "override me!"
  # end


  def update width, height, mouse_x = nil, mouse_y = nil, player = nil
    @y += @current_speed

    super(width, height, mouse_x, mouse_y)
  end

  def collected_by_player player
    raise "Override me!"
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
line-em-up-0.3.5 line-em-up/models/pickup.rb