javax.sound.sampled.LineUnavailableException: Audio Device Unavailable
at com.sun.media.sound.HeadspaceMixer.nResume(Native Method)
at com.sun.media.sound.HeadspaceMixer.implOpen(Unknown Source)
at com.sun.media.sound.AbstractMixer.open(Unknown Source)
at com.sun.media.sound.AbstractMixer.open(Unknown Source)
at com.sun.media.sound.AbstractDataLine.open(Unknown Source)
at class.k.<init>(Unknown Source)
at class.s.<init>(Unknown Source)
at com.mojang.mario.AppletLauncher.init(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Using Ubuntu Linux (Dapper Drake), fully updated… Linux + Sound + Java is a total mess. Something that should “just work” - but it’s Linux… so it will require days of hunting and configuration… sigh… when will I learn that it just isn’t worth even trying to use Linux.
On another note… I may enter this contest - time permitting. I wanted to play around with OpenGL for 2D games as I’m an OpenGL newbie… So I grabbed Kev’s Space invaders tutorial that has both a Java2D and an OpenGL (JOGL) renderer. It’s helped very much to get started, but one comment…
DON’T start game loops from a constructor in sample code!!!
I started refactoring the Space Invaders code to form a customized game engine for this contest… I made a game base class and separated out the specific game logic into a subclass and then noticed that the Java2D version stopped working properly. It was all because of the game loop being started from the constructor of my new ‘Game’ base class . When you start threads or trigger things from a constructor it makes the class too dangerous to subclass. The threads or game loops start running before the subclass constructor runs, and if your constructr never returns, well than the subclass constructor never runs either. And that, of course, buggers everything up.
I only mention this because the Space Invaders code is offered as a tutorial for Newbies and it should therefore avoid questionable practices that would be more at home in the wacky world of a 4k contest. Overall I have high praise for the tutorial, thanks Kev. I hope you don’t mind that I intend to steal bits of it for this contest :). I’ll give you credit of course.
Another question regarding the contest. The rules say that we can only use the supplied bitmaps for sprites and such, as well as out own particle effects. Are we allowed to use any procedurally generate graphics, such as filled polygons, for background elements, text, or whatever? Extending the idea that scale2x is allowed, I assume that I am allowed to rotate and scale the bitmaps in any way so long as I’m not actually drawing on them to make a new picture?