0

I used bundler to create a new gem, and I'm playing with rubygame. So far, it's going OK, except I can't get images on the Surface because I can't figure out what the path is to my images directory. I know it's sad, but I'm sorta used to Rails loading my images for me.

The full path to the image is: /usr/local/src/jewel_thief/lib/jewel_thief/images/player.png.

and I'm trying to use it in:

/usr/local/src/jewel_thief/lib/jewel_thief/player.rb (view source)

What am I doing wrong?

James Dunn
  • 192
  • 15

2 Answers2

1

Change

@image = Surface.load 'jewel_thief/images/player.png'

To

@image = Surface.load '/jewel_thief/images/player.png'

I think following also work

@image = Surface.load '/jewel_thief/lib/jewel_thief/images/player.png'
Salil
  • 46,566
  • 21
  • 122
  • 156
0

The path ended up being this:

@image = Surface.load 'lib/jewel_thief/images/player.png'

Finally, after being stumped for hours. Thanks for the help though! Really.

James Dunn
  • 192
  • 15