I am a beginner with ruby and gosu
I got a problem since a few day.
All was fine untill I try a new map without touching the code
Now I sometime got that kind of error for variouse thing it says that "Ruby interpretor has stopped working"
I managed to find the buged line and it was a very simple Gosu::Image.new like that:
@fond = Gosu::Image.new($window, "Graphique/Game Over.png", true)
I can't find why does that error come but it very irritating
Sorry for my bad english : As you have saw I 'm french and english it not my language
Does it always happen in this line? Are you playing sound effects too?
It not always that line but it always a Gosu::Image.new
When I try, for testing, to delete this line, the bug happen at the next image load but some Image already have been load (and draw) before.
I think it may be because i have too many Image loaded!
I dont play sound effect for now.
Are you getting any error messages printed to the console?
If you are using ruby 1.9, then it could be that your filepath is "Graphique/Game Over.png" instead of "./Graphique/Game Over.png". Notice the "./" in front. I believe I had a similar problem when I switched from 1.8 to 1.9.
No: absolutly no error message in the console. It the reason why i have decide to post here!
I also had to use "special trick" to find the buged line
I try your advice but it dont work anymore!
I had assumed as much, just checking ^_^;
What directory are you running the game from? I had assumed you were in the base directory for your project. By "not working" do you mean it fails to execute at all? Perhaps you are in the wrong directory then.
If you put the following line at the top of your main file, your program should run in the correct directory.
I think it not a directorie probleme: Some Image, located in the same directorie are loaded without probleme!
Ah, sorry about that then. Hopefully you'll get your problem solved.
Hmmmm, you can try to use Gosu 0.7.29 (
gem uninstall gosu,
gem install gosu -v 0.7.29). Gosu 0.7.30 started to use a different image library. If the problem goes away, it is really an issue with the image loading.
It dont work: it apparently not a loading issue
I also forget to precise an importante thing: I Use texplay (but for only for the get_pixel methode)
I also had such issue with TexPlay, but not with get_pixel. Maybe try to disable it to check if it's the problem?
If I disable it nothing wont work because I use it for my map systeme! (The map is a litle image that a few line of code converte to a level)
My game can't work without it
Can you show us that part of the code? Is it possible that you don't keep a reference to the Gosu::Image, so it will be garbage-collected while TexPlay still references it?
Sorry for haven responde since your message. But I have tryed to rewrite my code for it to dont need texplay! (I am that that my last phrase is correct)
But i have minort erore not related to gosu that i have to fix first.
So i wont be able to tell you if the "texplay-less" version work, before!
I will update this message when as soon i can!
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill