This site requires JavaScript, please enable it in your browser!
Greenfoot back
LegendXV
LegendXV wrote ...

2014/4/18

Directory Pathing

LegendXV LegendXV

2014/4/18

#
So I got a pretty big issue ... when I upload the Greenfoot project it's unable to be played because the directories are solely in my computer ... Is there a way to make the directory universal? How else would I get the game to be playable on other computers? And is there a way to make the game into an .exe file?
danpost danpost

2014/4/18

#
Copy the images you need for the project into the 'images' folder of the project folder. If that is where they already are, refer to them in your code only by the name of the file.
// do not do this
setImage("C:Greenfoot/FBLA Greenfoot/images/Main Menu.jpg");
// do this
setImage("Main Menu.jpg");
If that is not what you are doing wrong, possibly it is the space in the filename that is causing problems. Rename the file as 'MainMenu.jpg'. Hope one of these fixes it.
LegendXV LegendXV

2014/4/20

#
What would I do for media/sounds? And is it possible to make an EXE
bourne bourne

2014/4/20

#
You can export the game as a .jar file, which I have packaged as a Mac application before, I'm sure there is something similar for .exe Try Googling "jar to exe" Here is the guide for jar to Mac application: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html
danpost danpost

2014/4/20

#
There is a 'sounds' file in the project folder also. Ensure the sounds are included in it; name them properly and refer to them in your code with the same names; also, ensure there are no informations tags within the sound files (author, title, etc.) as they can mess with the processing of the file within greenfoot (I think an IndexOutOfBoundsException occurs).
You need to login to post a reply.