Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

All images are showing in Eclipse, only half when exported as Runnable Jar

 
Ivan Slavka
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys!

I have a very strange problem. And I can't figure out what could be the problem.
I am developing my clone of the old game Frogger, I think that everybody knows the game I'm talking about.
Well the main reason to develop Frogger is to learn about java games and 2D graphics, anyway this is my problem.

When I run my Frogger application in Eclipse, all the images are shown with no problem with the appropriate animation
(Logs moving in one direction car in another), then when I export this project as Runnable Jar and start it, I can see all images,
except the car images. I know that the missing car images are moving because when I move my frog on the road it gets killed (returns to the start position.)

This is my class that loads and holds the required images. All the images are in the same folder (source)


This is my complete frogger application, feel free to download and study the code. (I didn't test on another machine, so if it works well on your machne let me know.)
Frogger
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had to decompile your class files to find the problem, but it was quite obvious after that. Your files are called Car_A.png and Car_B.png, but the resource names are CAR_A.png and CAR_B.png. Unlike regular files on Windows, resources are case sensitive.
 
Ivan Slavka
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, Rob, thanks.

I wouldn't guess that, not in a million years. Well they could put that into the JavaDoc.
Thanks once again!
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic