• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome
 
There's a hole in the bucket, dear Liza, dear Liza, a hole in the bucket, dear liza, a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic