You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have a question about game objects. How can I know if exist objects of a particular class? That is, I need to do something like:
if Enemy.empty?
# logic if not objects of Enemy class.
end
Could create an Array with all the enemies but do not want to create variables if not necessary. I tried with "Array(Enemy).empty?" but nothing.
Another question is that when I load a font, the console throws me this:
ERROR: failed to open './resources/8_bit_madness.ttf'
ERROR: CreateFile failed
The code is this:
@ text_starge = Text.create (: text => "# {@ starge STARGE}",: size => 25,: font => "resources/8_bit_madness.ttf")
Any help?. Thanks!
The text was updated successfully, but these errors were encountered:
About the font-error: Under the hood Chingu uses Gosu::Font.new to draw text .. so a font-error most likely comes from there. You might want to check your paths .. but if the path is 100% correct, you need to check into why Gosu doesn't want to open that font. Try open it with pure Gosu for example.
I had a small mess in the organization of the directories and therefore Chingu did not recognize me the assets correctly. Indeed, Enemy.all fix everything, is easy to manipulate the objects using arrays. Thank!!
Hi, I have a question about game objects. How can I know if exist objects of a particular class? That is, I need to do something like:
if Enemy.empty?
# logic if not objects of Enemy class.
end
Could create an Array with all the enemies but do not want to create variables if not necessary. I tried with "Array(Enemy).empty?" but nothing.
Another question is that when I load a font, the console throws me this:
ERROR: failed to open './resources/8_bit_madness.ttf'
ERROR: CreateFile failed
The code is this:
@ text_starge = Text.create (: text => "# {@ starge STARGE}",: size => 25,: font => "resources/8_bit_madness.ttf")
Any help?. Thanks!
The text was updated successfully, but these errors were encountered: