> Re: the distribution thing, you should check out Releasy. There's a link on the Gosu homepage.
require
or require_relative
:Window
, you don't need to use @@class_variables
here:$current_room
doesn't need to be a global variable, I think.{}
around hash argument lists:Font.new(18, :name => "foo")
is enough.Window#close
, it's usually best to return from the method (instead of forwarding the button press, in this case):%w(camel-head donkey frog ...).each_with_index do |name, index|
@images[index + 1] = Gosu::Image.new("images_animals/#{filename}.png", :retro => true)
end
if @cards.compact.empty?
:best_time
. I'd rename it to game_ended?
and move the assignment to best_time
into button_up
, into the if game_ended...
block.Gemfile
and Gemfile.lock
. That way, it is clear (without reading the README) which version of Gosu you used to develop your game. This makes it a lot easier to other people to debug issues such as running the game with a version of Gosu that's too old (say, 0.7.50). This applies to all sorts of Ruby projects.
> Most of it is nitpicking, but I think that's what you asked for - hope that helps :)
def img(name)
$_images ||= {}
$_images[name] ||= Gosu::Image.new(name)
$_images[name]
end
img("images_animals/#{filename}.png").draw(x, y, z)
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill