Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: Applet Deployment - Images not showing on: 2012-08-28 23:48:58
Have a separate folder called "res"  (or whatever) and add it to your build path.

Project -> Properties -> Java Build Path -> Source -> Add folder.

This is how I had it set up before. But I did not try adjusting my code to read from a URL. I just tried it this way and it seems to work fine also, so thank you for that =). Anybody know if one way is more reliable than the other? (URL or adding images to source folder) What I am thinking is (using URL), as long as the webpage loads, using URL would be able to find the images. Or (using source folder for images) as long as the applet loads fine the images should load fine. They seem like pretty equal solutions to me, but I am not 100% sure. Anyways I'm just glad I got it working now and thank you jonjava =)
2  Game Development / Newbie & Debugging Questions / Re: Applet Deployment - Images not showing on: 2012-08-28 21:05:42
Dang.. Nobody?? Oh well.. I ended up figuring it out after messing around a bit.

After researching this topic I have found tons of posts with people asking the same question, none of them ever really seeming to find the solution to their problem. I would expect there to be resources for this topic out there somewhere, but after hours of searching I found absolutely nothing. When searching 'Applet deployment' basically all that comes up, is how to embed applets in a webpage... Great... I saw person after person asking 'Why do my images not show when run through the browser, but work fine when run in my IDE?' I then saw people throwing around very vague answers like 'add image parameters in html' or 'download this applet bundling program...'

The solution is extremely simple (at least with the problem I was having) and so I will post it here, to hopefully save someone the trouble I just went through. My Images folder for my project was a separate folder, which was called as a resource through the Java Build Path. This works fine when running the project through eclipse or command line, but does not show the images when run through a browser.

So I copied my images folder into the source folder and erased the old Images folder. Then adjusted my code to read from the correct path.

Image treeimg = getImage(getDocumentBase(), "../Images/tree.png");

Image treeimg = getImage(getDocumentBase(), "Images/tree.png");

It now shows my images on the browser. I guess the reason is, when exporting an applet, files in the source folder are automatically compressed into the Jar file. So my understanding is that it is best to keep resources along with source (for Applets) I guess? I am sure there are other ways, but after hours of fuming over this, this seems like the easiest solution and works fine.

Anyways, I just hope someone else can use this info because it doesn't seem to me that anyone else has taken the time to explain this very well. As long as you are putting everything in the correct path, this should work fine.
3  Game Development / Newbie & Debugging Questions / Applet Deployment - Images not showing on: 2012-08-28 09:45:29
Hello everyone,

After hours of frustration, I have finally gotten my Java applet to display on my web page, but only adding to the frustration. The problem I am having now is none of my images are displaying. Only shapes, text and colors drawn by Java are showing up.

Images in my program are called like so:
Image treeimg = getImage(getDocumentBase(), "../Images/tree.png");

...which after researching, I found out can cause problems. If that is the case, can anyone give suggestions as how to modify this in the least painful way? I'm not even 100% sure that this is the problem.

I'm also pretty new to html but I'm pretty sure I have everything in the right folders and whatnot. The game loads fine, just no images. Maybe I need to call some parameters for the applet in the html file?

I have researched pretty thoroughly and have basically come up with nothing so any help would be very appreciated =)
4  Discussions / Community & Volunteer Projects / Re: Looking for collaboraters for Java platform Game on: 2012-08-02 07:41:34
Wow! Thanks for the comments everybody! I was having some trouble exporting it, but I think I have managed to now, so I will upload it and let you guys give it a shot. Heres the link:

I will put the control info in the game later but for now:
Left/Right Arrows or A,D to move
Up arrow or W to jump
Space to shoot
Hold z for faster movement
pretty sure thats it for now...

This is sort of a debugging issue, so if some of you can try it out and let me know if it runs on your systems I would really appreciate it. If it works fine, I will upload it to the showcase. Also please please pleeease don't steal my images.. I put a lot of time into most of them and they aren't even that great, but still, just don't please.

Again thanks so much for the comments guys and sorry for the late reply. I guess I wasn't subscribed to this post. woops =)

Are you going to sell this once you're finished?

That would be super awesome but I don't know if I'm at that level to be able to sell my games. Its a super simple game at this point but maybe if I keep putting time into it I can get it to that point. That would be radical!

I hope not to use any external libraries like slick or LWJGL.
We have some great third parties in Java, why not using it?  Undecided

This is the first "real" game I have ever made, other than tic-tac-toe and Greenfoot games and crap like that. I just want to have a good understanding of Java before diving into game libraries =)

Looks really good! Best of luck Smiley How did you draw gradient text with Java2D, by the way?

Im not gonna lie.. It's just a font I found on some website. And the title is just a 4 image animation I made, looped over. Later I might try making a spritesheet for different fonts =)

I too started looking at Mr. Brackeen's book, but for every chapter I was just thinking "Dude, this could be done SO much better!", meaning I wanted a challenge, and didn't find many in there. Don't get me wrong, it's a great book for ones first game, but as I've done a big RPG-game already, I felt I wanted more than a little guy jumping about. It did teach me something about controlling animations and such, though.

Good luck with the project, and once again: I WANNA TRY IT!

Yeah I know what you mean. He definitely could have made it much better, but I guess that's what I'm hoping to do (already added shooting/ upward scrolling/special tiles/score/lives etc =)). But yes, about a week into it I did get a little bored with it and I actually made a little top-down RPGish engine thing out of the same game. Since this is my first real game though, I think a platformer would be a little bit simpler and easier to learn from so I'm gonna stick with this for now. PS: Your game sounds awesome!!!
5  Game Development / Newbie & Debugging Questions / Re: Failure exporting runnable JAR on: 2012-07-29 07:22:01
Sorry my idea didn't help.
Probably someone at Eclipse can, though, if someone here doesn't come through first. I've had excellent help at the "Newcomers" forum.

That is an excellent idea I should have thought of that. Thank you I'll give it a try =)
6  Game Development / Newbie & Debugging Questions / Re: Failure exporting runnable JAR on: 2012-07-29 03:20:48
I don't recognize your IDE screen. (Not surprising, since I only know my version of Eclipse.) What IDE are you using?

Im also using Indigo (Version: Indigo Service Release 1) but this is the Runnable JAR option so I guess thats probably why it doesn't look familiar. I did also try just exporting a regular JAR, and chose the option "Generate manifest file" and specified the main class, but still got the same error: cannot find main class.

I should also add that when I run it through the command line, everything loads fine
7  Game Development / Newbie & Debugging Questions / Failure exporting runnable JAR [SOLVED] on: 2012-07-28 22:53:40
Hi. In the process of learning Java I have mainly been making very simple programs. But now I actually have a project, still in progress, that I am very proud of so far. Anyways I would like to export it as a runnable JAR (its a game), but I seem to be failing to do so. What I do is, File> Export> Runnable JAR and this comes up:

and I click finish.. Seems pretty straightforward. I get a popup saying "JAR export finished without warnings" and everything seems good. But when I try to run it, I get this error: "Could not find the main class:...Program will exit"
I have searched a few forums with people having the same problem, but non of their solutions have seemed to work for me (or I am just doing something wrong). One thing I read is that it could be something with the Environment Variables path. I am aware of how to edit it, but I am not exactly sure what I would need to change (or if it even really matters). The program I am trying to export also uses images and reads info from a txt file. Not really sure if thats a big deal either. Also uses no external libraries or anything like that, just pure Java.

As you can probably tell I am a total n00b and if anyone can walk me through what I should do in the simplest possible way, I would really really appreciate it. Thanks people! =)
8  Discussions / Community & Volunteer Projects / Looking for collaboraters for Java platform Game on: 2012-07-25 08:58:23
Hi! I have been working on a simple platform game in Java, using David Brackeen's tile based game engine ( as a template. I spent a lot of time on sprites and tile images and have a start for a pretty decent looking 2D platformer. I've done some simple things with the programming like added water which effects player gravity, added springs which launch the player in the air, added a score, hit points, life counter etc. The game has super creepy awesome background music, and some oldschool 8 bit sound effects. But I've hit that point where I really need someone elses opinion and programming skills to get this going any further.

If anyone is interested, send me a reply or email me at along with something you have made in java and are proud of. I'm looking for someone with a very good knowledge of java as I hope not to use any external libraries like slick or LWJGL.

Here's some screenshots (just one level so far):

Thanks people! Hope to hear from some of you soon =)

EDIT: Not sure if this will run on your system but here it is:

I will put the control info in the game later but for now:
Left/Right Arrows or A,D to move
Up arrow or W to jump
Space to shoot
Hold z for faster movement
pretty sure thats it for now...
Pages: [1]
DesertCoockie (22 views)
2018-05-13 18:23:11

nelsongames (72 views)
2018-04-24 18:15:36

nelsongames (67 views)
2018-04-24 18:14:32

ivj94 (751 views)
2018-03-24 14:47:39

ivj94 (81 views)
2018-03-24 14:46:31

ivj94 (605 views)
2018-03-24 14:43:53

Solater (97 views)
2018-03-17 05:04:08

nelsongames (170 views)
2018-03-05 17:56:34

Gornova (388 views)
2018-03-02 22:15:33

buddyBro (1048 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!