This gem just provides some methods to get game grid, fill it with cells, and move stuff around. You can easely modify it for your needs. Feel free to contribute in this project if you find it useful or interesting.
Add this line to your application's Gemfile:
gem 'gosu_grid'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gosu_grid
class DeadCell < Gosu::Grid::Cell
def size
object.width
end
private
def object
@object ||= Gosu::Image.new(window, 'assets/dead_cell.png', true)
end
end
class GridGameExample < Gosu::Window
def initialize
super(540, 320, false)
@grid = Gosu::Grid.new(self)
@grid.default_cell = DeadCell.new(self, 0, 0)
end
def draw
@grid.draw && sleep(0.05)
end
end
more examples here
- Fork it ( https://github.com/shemerey/gosu_grid/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request