--windows
so that it doesn't open a console window when the executable runs. I'd also recommend you build the exe with Ruby 1.9.3 since it is a lot faster to start up than 1.9.2 and a lot faster to run than 1.8.7 (both matter when making games :D). If you do that, you need to manage paths a bit better, by always using file-relative paths, rather than working-directory-relative paths, since, for example, running "clone4\clone4.exe" won't work.
def image_path(rel_path)
File.expand_path(File.join("../../media/images", rel_path), __FILE__)
end
def song_path(rel_path)
File.expand_path(File.join("../../media/music", rel_path), __FILE__)
end
# then you can do
@img = Image.new $window, image_path("frog.png")
require_relative
so that is fine for requiring. If you need 1.8.7 compatibility, then make sure you do something like:$LOAD_PATH.unshift File.expand_path("../../", __FILE__)
require
paths will be relative to that directory.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill