Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (16 sloc) 0.369 kb
require_relative "screen"
class Sprite
DIR = File.expand_path File.join(File.dirname(__FILE__), "images")
attr_reader :sprite
def initialize(file)
@sprite = sprite_for "#{file}.png"
end
def draw_on(surface, x, y)
surface.draw(self, x, y)
end
private
def sprite_for(file)
file = File.join(DIR, file)
Screen.sprite_for(file)
end
end
Jump to Line
Something went wrong with that request. Please try again.