<solved>How to pack resources in my game ?

After compiling the game I can find the executable in the bin folder. But it does not work; says unable to load images :frowning: and terminates immediately.

Edit to make the original question understandable, I had finished making the game. I wanted to pack the game alongwith its resources, as a windows executable file (.exe), so that I can distribute it to others. I was having a little problem because I had never done it before, but now the problem is solved. I used a software called inno-setup and that solved the problem.

Can you explain your problem in a little more detail ? If you went the normal-common way of exporting, you should just get a single file which has everything packed in. Any further help would require more details.

Not trying to be rude, but your post is very vague. Without supplying us with how you store your resources or access them, the best we can do is give you a quick tutorial and hope that helps, or link you to a tutorial elsewhere.

Do you use an IDE?
If so, which one?
Are your images stored within a folder in the project?
If not, where are they?

If you’re using Eclipse, I might be able to help somewhat.

I.E.
Your project’s main folder is called SomeRandomGame.
And your source is located at /SomeRandomGame/src
You can put a folder in /SomeRandomGame (The name is irrelevant) we’ll call it Resources.
So now you’re storing your images in /SomeRandomGame/Resources
If you created this folder outside Eclipse, refresh your project to update Eclipse(Right-click your project and click Refresh).

From there, right-click your Resources folder, highlight Build Path, and select “Use as Source Folder”

This is just a snippet,

public SpriteSheet(String p)
	{
		BufferedImage image = null;
		
		try
		{
			image = ImageIO.read(getClass().getResourceAsStream(p));
			if(image != null)
			{
				width = image.getWidth();
				height = image.getHeight();
				pixels = new int[width * height];
				image.getRGB(0, 0, width, height, pixels, 0, width);
			}
			else
			{
				System.out.println("Error: image == NULL @Path: "+p);
			}
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		if(image != null) { Game.debug("SpriteSheet @Path: "+p+" Created"); }
	}

The only part that’s relevant to you is:
image = ImageIO.read(getClass().getResourceAsStream§);
Where p = “/Resources/player_sprite_sheet.png”

You’re accessing them in a relative matter, omitting “/SomeRandomGame”/Resources/player_sprite_sheet.png

I hope this helped a bit, teaching isn’t something I’m good at. If I need to make it clearer, let me know. Good luck, hope you’ve been searching through learning materials since your post.

I actually solved this problem very long time ago. I just used a software called inno-setup and that solved the problem.

That is okey I know the original question I posted was not clear. You thought I am talking about in-gaming resources loading.