Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
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
http://gyazo.com/ffa311214e75bf5cf73590179d1522fc.png
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
(screenshot http://gyazo.com/6574a04ef10d2b8ad18ed62dc2e87cdd.png)
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 https://code.google.com/p/jbox2d/wiki/QuickStart 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".]
1  
2  
3  
4  
5  
//      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.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
public Sound() throws LineUnavailableException, UnsupportedAudioFileException, IOException, URISyntaxException {
     
      InputStream in;
      try {
     
      in = new FileInputStream(new File(this.getClass().getResource("/music/Castle.au").toURI()));
      AudioStream as = new AudioStream(in);
      AudioPlayer.player.start(as);        
     
      } catch (FileNotFoundException e) {
         e.printStackTrace();
      }

   }


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 sun.audio 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.
 http://gyazo.com/203ebffccd5c77d07604e022d2a8a6cb

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.

Thanks,
Chibi
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/Title.au); )



import sun.audio.*;
import java.io.*;

@SuppressWarnings("restriction")
    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);
          
          AudioPlayer.player.start(as);
          
          
          } catch (FileNotFoundException e) {
             e.printStackTrace();
          } catch (IOException e) {
             e.printStackTrace();
          } catch (URISyntaxException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
         }
        }
        public void stopMusic(){
           AudioPlayer.player.stop(as);
        }
       
       
    }



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

http://gyazo.com/9ad0ee0537666cbac19060c564a0be7c

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]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (26 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (13 views)
2014-08-16 06:20:21

Tekkerue (20 views)
2014-08-16 06:12:11

Rayexar (58 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!