Sha256: ea1afe4635e7f181fce9a004ccd0ba422bdd034f57b87e8d489fe35d398acef0

Contents?: true

Size: 589 Bytes

Versions: 13

Compression:

Stored size: 589 Bytes

Contents

class CollidableShape
  attr_accessor :opts, :actor, :radius

  attr_reader :cw_world_points, :cw_local_points, :cw_world_lines, :cw_world_edge_normals

  def initialize(actor, options)
    @opts = options
    @actor = actor

    @x_offset = opts[:x_offset]
    @y_offset = opts[:y_offset]
    @x_offset ||= 0
    @y_offset ||= 0
  end

  def actor_x
    @actor.x + @x_offset
  end

  def actor_y
    @actor.y + @y_offset
  end

  # TODO find out if this is called
  def setup
  end

  def width
    @radius * 2
  end
  alias :height :width

  def recalculate_collidable_cache
  end


end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gamebox-0.5.5 lib/gamebox/behaviors/collidable/collidable_shape.rb
gamebox-0.5.4 lib/gamebox/behaviors/collidable/collidable_shape.rb
gamebox-0.5.2 lib/gamebox/behaviors/collidable/collidable_shape.rb
gamebox-0.5.1 lib/gamebox/behaviors/collidable/collidable_shape.rb
gamebox-0.5.0 lib/gamebox/behaviors/collidable/collidable_shape.rb
gamebox-0.4.1 lib/gamebox/behaviors/collidable/collidable_shape.rb
gamebox-0.4.0 lib/gamebox/behaviors/collidable/collidable_shape.rb
gamebox-0.4.0.rc11 lib/gamebox/behaviors/collidable/collidable_shape.rb
gamebox-0.4.0.rc5 lib/gamebox/behaviors/collidable/collidable_shape.rb
gamebox-0.4.0.rc4 lib/gamebox/behaviors/collidable/collidable_shape.rb
gamebox-0.4.0.rc3 lib/gamebox/behaviors/collidable/collidable_shape.rb
gamebox-0.4.0.rc2 lib/gamebox/behaviors/collidable/collidable_shape.rb
gamebox-0.4.0.rc1 lib/gamebox/behaviors/collidable/collidable_shape.rb