class PowerupGraphics

Public Class Methods

new(object, type) click to toggle source
Calls superclass method Component::new
# File lib/entities/components/powerup_graphics.rb, line 2
def initialize(object, type)
  super(object)
  @type = type
end

Public Instance Methods

draw(viewport) click to toggle source
# File lib/entities/components/powerup_graphics.rb, line 7
def draw(viewport)
  image.draw(x - 12, y - 12, 1)
  Utils.mark_corners(object.box) if $debug
end

Private Instance Methods

image() click to toggle source
# File lib/entities/components/powerup_graphics.rb, line 14
def image
  @image ||= images.frame("#{@type}.png")
end
images() click to toggle source
# File lib/entities/components/powerup_graphics.rb, line 18
def images
  @@images ||= Gosu::TexturePacker.load_json(
    $window, Utils.media_path('pickups.json'))
end