Skip to content

Instantly share code, notes, and snippets.

@poemdexter
Created April 10, 2012 02:15
Show Gist options
  • Save poemdexter/2347926 to your computer and use it in GitHub Desktop.
Save poemdexter/2347926 to your computer and use it in GitHub Desktop.
class World
attr_reader :grid, :width, :height
def initialize(window)
@width = 20
@height = 20
@grid = Array.new(width,[])
@grid = @grid.map {Array.new(height,0)}
@target_sprite = Gosu::Image.new(window, "target.bmp", true)
end
def draw
@grid.each_with_index do |inner, x|
inner.each_index do |y|
@target_sprite.draw(x*24,y*24,0)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment