Slick Forums

Discuss the Slick 2D Library
It is currently Mon May 20, 2013 3:28 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Wed Aug 15, 2012 5:04 am 
Offline

Joined: Sat Aug 11, 2012 10:13 pm
Posts: 35
So for my main menu I wanna get to adding in some music so I feel achieved and I can say I have worked with sound. I am doing most things right like having my file location correctly, but I get this error on start up:
Code:
Tue Aug 14 21:46:12 PDT 2012 INFO:Slick Build #274
Tue Aug 14 21:46:12 PDT 2012 INFO:LWJGL Version: 2.8.4
Tue Aug 14 21:46:12 PDT 2012 INFO:OriginalDisplayMode: 1280 x 1024 x 32 @75Hz
Tue Aug 14 21:46:12 PDT 2012 INFO:TargetDisplayMode: 800 x 600 x 0 @0Hz
Tue Aug 14 21:46:12 PDT 2012 INFO:Starting display 800x600
Tue Aug 14 21:46:12 PDT 2012 INFO:Use Java PNG Loader = true
Tue Aug 14 21:46:12 PDT 2012 INFO:Controllers not available
Tue Aug 14 21:46:13 PDT 2012 INFO:Offscreen Buffers FBO=true PBUFFER=true PBUFFERRT=false
Tue Aug 14 21:46:13 PDT 2012 DEBUG:Creating FBO 16x16
Tue Aug 14 21:46:13 PDT 2012 INFO:Initialising sounds..
Tue Aug 14 21:46:13 PDT 2012 INFO:- Sound works
Tue Aug 14 21:46:13 PDT 2012 INFO:- 64 OpenAL source available
Tue Aug 14 21:46:13 PDT 2012 INFO:- Sounds source generated
AL lib: FreeContext: (000000000ABF8200) Deleting 64 Source(s)
Exception in thread "main" java.lang.NoClassDefFoundError: com/jcraft/jorbis/Info
   at org.newdawn.slick.openal.OggInputStream.<init>(OggInputStream.java:35)
   at org.newdawn.slick.openal.OggDecoder.getData(OggDecoder.java:311)
   at org.newdawn.slick.openal.SoundStore.getOgg(SoundStore.java:835)
   at org.newdawn.slick.openal.SoundStore.getOgg(SoundStore.java:793)
   at org.newdawn.slick.Music.<init>(Music.java:135)
   at org.newdawn.slick.Music.<init>(Music.java:74)
   at com.src.impostor.StateMenu.init(StateMenu.java:26)
   at com.src.impostor.Game.initStatesList(Game.java:30)
   at org.newdawn.slick.state.StateBasedGame.init(StateBasedGame.java:164)
   at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
   at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
   at com.src.impostor.Game.main(Game.java:40)
Caused by: java.lang.ClassNotFoundException: com.jcraft.jorbis.Info
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 12 more

From what I understand is that it can't read the .ogg file which confuses me. I declared an object of Music, said the file location in the init() and then did <variable>.loop() also in init after the file location. Is there any way you guys can help point me out on how to fix this. Also if somebody could help teach how to do a separate Input class and Button class that can detect collisions.
Thanks,
-Imposter


Top
 Profile  
 
PostPosted: Wed Aug 15, 2012 8:33 am 
Offline
Regular
User avatar

Joined: Thu May 05, 2011 8:35 pm
Posts: 231
Location: Somewhere between the bits and bytes
Looks like it can't find the jorbis library.
Have you set up the jorbis jar correctly on your build-path?

_________________
For every new problem, a new source of solutions has come to exist.


Top
 Profile  
 
PostPosted: Thu Aug 16, 2012 2:34 am 
Offline

Joined: Sat Aug 11, 2012 10:13 pm
Posts: 35
So I need to get jorbis?


Top
 Profile  
 
PostPosted: Thu Aug 16, 2012 2:41 am 
Offline

Joined: Sat Aug 11, 2012 10:13 pm
Posts: 35
So I got JOrbis and that fixed the error, but now when I use it it plays through all the states. So is there possibly anyway to fix this, I know the enter() and leave(), but where do I call them on the start up of a state.


Top
 Profile  
 
PostPosted: Thu Aug 16, 2012 10:23 am 
Offline
Regular
User avatar

Joined: Thu May 05, 2011 8:35 pm
Posts: 231
Location: Somewhere between the bits and bytes
Enter and leave are called automatically, as you switch state with StateBasedGame.enterState(), first leave() is called on the old state, then enter() is called on the new state, just make sure you override them correctly in your gamestates.

_________________
For every new problem, a new source of solutions has come to exist.


Top
 Profile  
 
PostPosted: Thu Aug 16, 2012 1:29 pm 
Offline

Joined: Sat Aug 11, 2012 10:13 pm
Posts: 35
I am not allowed to put @Override methods on them with out giving me an error saying there is no need for them. I put the methods in there and they don't seem to be getting called because the music doesn't play in the enter method. Also would you possibly know a good jump algorithm for when a player jumps?


Top
 Profile  
 
PostPosted: Fri Aug 17, 2012 5:47 pm 
Offline
Regular
User avatar

Joined: Thu May 05, 2011 8:35 pm
Posts: 231
Location: Somewhere between the bits and bytes
Are you sure you override them correctly, in the correct place(BasicGame or BasicGameState)?
post the full gamestate?

And about your other question, you should create a new topic for that one, where you explain what kind of game you are making and how you want the jumping to work, since a jumping algorithm can be quite game specific. :)

_________________
For every new problem, a new source of solutions has come to exist.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group