Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
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: setting up the jbox2d library on: 2013-10-09 20:06:31
Well I guess its solved now. Grin Not sure how I got so confused. I just had to add external jar file to build path as the one that is with dependencies
2  Game Development / Newbie & Debugging Questions / Re: setting up the jbox2d library on: 2013-10-09 18:20:29
Okay so I've imported as a maven project, but it had an error with "execution add-source, in jbox2d-serialization/pom.xml" and now the only errors present are in the jbox2d-serialization package.

I have an error with pom.xml saying:
  "Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.7:add-source (execution: add-source, phase: generate-sources)"

I also am having errors in PbSerializer and PbDeserializer in importing from org.box2d as opposed to the error free org.jbox2d imports.
3  Game Development / Newbie & Debugging Questions / Re: setting up the jbox2d library on: 2013-10-09 08:03:07
Error: Editor does not contain a main type
4  Game Development / Newbie & Debugging Questions / Re: setting up the jbox2d library on: 2013-10-08 20:39:22
Well the first problem is in the SVN checkout as said on the site, where apparently the file jbox2d-read-only does not exist
5  Game Development / Newbie & Debugging Questions / Re: setting up the jbox2d library on: 2013-10-08 20:21:17
wow I swear I typed that out, my bad. Tongue
I'm using eclipse, but I've used netbeans so that works too.
6  Game Development / Newbie & Debugging Questions / [SOLVED] setting up the jbox2d library on: 2013-10-08 20:13:09
Hi. There isn't a single good explanation on how to do this anywhere, so I'd like this explained to me step by step like I'm 5. All I want is to integrate the jbox2d library with my IDE so that I can actually use it. I've used tons of libraries before, lwjgl, slick2d, openAL, jinput, etc. But I just can't figure out for the life of me how to get this thing working. Maybe I just don't understand svn or Maven, or how this was made or is supposed to work, but I've tried every possible option listed on at least 3 times. I've not gotten any of it to work once. All I get are errors and I'm not skipping any steps. If anyone has done this before and can explain it to me like I've never used an IDE before, that would be much appreciated. Thank you for your time.  Cheesy
7  Game Development / Newbie & Debugging Questions / Re: Disabling the Anti-Aliasing in LWJGL/Slick2d Textures on: 2012-02-19 01:00:33
Thanks for clearing that up, its all working fine now!
8  Game Development / Newbie & Debugging Questions / [SOLVED] Disabling the Anti-Aliasing in LWJGL/Slick2d Textures on: 2012-02-18 17:53:05
I've discovered that LWJGL automatically has anti-aliasing active for 2d textures imported through Slick2d. I've been digging around and found that supposedly GL_TEXTURE_MAG_FILTER controls it, but I'm not sure how to disable it, and GL11.glDisable(GL_TEXTURE_MAG_FILTER); didn't work.

If anyone's tried disabling the anti-aliasing before and knows how, your help is greatly appreciated!
9  Game Development / Newbie & Debugging Questions / Re: sound compiling problem - sound doesn't play in jar on: 2011-11-21 22:37:47
Question 1) Does the game work fine, from your jar, without sound? Are you able to load graphics for example?

Question 2) Do you get an error message?

There are a bunch of ways things can go wrong. Here's a new one I just learned:

Don't use InputStream. Load via the URL, directly to your AudioInputStream. In the following code example, the commented out is the way I used to load sounds, and it doesn't work with Java 7. But the URL form is fine, as InputStream (which throws an exception if the files are not 'markable') is not a factor.

[EDIT: Ack! The class "AudioSystem" is just the name of the class that this code happens to be located in. The file name is a relative address, for example: "audio/beep.wav".]
//      AudioInputStream ais = AudioSystem.getAudioInputStream(
//            AudioMixer.class.getResourceAsStream(fileName));

      URL url = AudioMixer.class.getResource(fileName);
      AudioInputStream ais = AudioSystem.getAudioInputStream(url);

But, it could very well be a problem with addressing resources. (That is why I asked #1.)
Or, you could have an error message that would tell us all. (Run the jar from a cmd prompt, and it will give you error messages.)

I changed my code so that it worked that way and now its working in the compiled jar.
Also that's interesting about toURI(), that seems to be the case that it doesn't compile.

Well, anyway, it works now and thank you all! Everything else about the game is mostly working, so I may post it in the showcase soon (when it's ready).
10  Game Development / Newbie & Debugging Questions / Re: sound compiling problem - sound doesn't play in jar on: 2011-11-20 20:34:24
I get no error messages. The jar works fine up until the point where it tries to run the method for sound, then everything hangs.

public Sound() throws LineUnavailableException, UnsupportedAudioFileException, IOException, URISyntaxException {
      InputStream in;
      try {
      in = new FileInputStream(new File(this.getClass().getResource("/music/").toURI()));
      AudioStream as = new AudioStream(in);
      } catch (FileNotFoundException e) {


That's about all I know how to do though. I've had years of coding in school, but the teacher only ever collects our src folder for a project, I'm quite the noob with running jars and programs through cmd, and it's pretty much impossible to find anything useful with a search.

I tried exporting it using "JAR File" but I can't figure out how to make it work and when I tried to use cmd to run it (I tried both the runnable jar and the jar file types with cmd) using java -jar<path> command it told me java was not a recognized as an internal or external command, operable program, or batch file.

11  Game Development / Newbie & Debugging Questions / Re: java sound compiling problem - no sound on: 2011-11-19 22:19:34
Sorry for replying so late to a pretty much dead thread, I got fed up with fixing the sound and worked on other more important parts of my game, but now I'm back at the sound problem and if anyone can specifically help me with this it would be appreciated greatly.

Thank you for all the ideas, I've decided to use sampled because I'd rather not import a new library right now.

I'm using java.sound.sampled.* and I have all my code right, nothing is wrong with it, and everything is working.
Pardon my oversight on whatever it is I'm missing because, though I'm not new to java at all, I'm relatively new to compiling and whatnot.

Basic problem:
Everything runs just fine in Eclipse. Sound plays and everything.
When I compile all of it into a jar file using the following process and settings, it runs but plays no sound and then freezes.

I do not want to use a different program, eclipse works just fine for me and I'm comfortable with it.
I'm not going to use any external libraries for this project or change my WORKING code.
And all of the files are IN the jar. Where they need to be. I use the same file retrieval method for sprites and loading levels. It works before and after compiling.

I would simply like some help with compiling the jar file so that it works.
Any help with the compiling would be greatly appreciated.

12  Game Development / Newbie & Debugging Questions / [SOLVED] sound compiling problem - sound doesn't play in jar on: 2011-10-25 18:04:20
I'm having problems getting sound to work with my java game. (I'm not using the lwjgl b/c I didn't know about it when I started, but I'm definitely going to use it for my next project  Cranky )

When I run the game in Eclipse, everything works how it's supposed to, but when I compile into a runnable jar, sound doesn't play. I also would like help making it loop, but the important part right now is that I get it working  Tongue

here is the current code I'm using, I create a new musicPlayer class at the beginning then call playMusic when I want to play a song and give it the file location in my project (ex: playMusic(music/; )


    public class musicPlayer{
       AudioStream as;
       InputStream in;
       public musicPlayer(){
        public void playMusic(String fna){
          try {
          in = new FileInputStream(new File(this.getClass().getResource(fna).toURI()));
          as = new AudioStream(in);
          } catch (FileNotFoundException e) {
          } catch (IOException e) {
          } catch (URISyntaxException e) {
            // TODO Auto-generated catch block
        public void stopMusic(){

I also have a screenshot of my project files so you can see where I have them stored in the src folder:

the classes are in the default package and the tracks I want to play are in the music folder

Any and all help/ recommendations/ redirection/ ideas are appreciated!
Pages: [1]
ivj94 (586 views)
2018-03-24 14:47:39

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

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

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

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

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

buddyBro (704 views)
2018-02-28 16:59:18

buddyBro (92 views)
2018-02-28 16:45:17

xxMrPHDxx (494 views)
2017-12-31 17:17:51

xxMrPHDxx (734 views)
2017-12-31 17:15:51
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!