JAVAsteroids

Thought of some other things -

  • Maybe recharge the shields between levels.

  • The text when you beat a level is hard to read.

  • Make the stars in the background a tad smaller. Make them twinkle. :slight_smile:

  • Maybe be really nutty and make a background that moves. Shooting comets or a swirling black hole and such.

  • To add a pseudo 3d effect. Make asteroids come from the background by making them small and then grow until they reach full size.

Whewā€¦ I need to go add my comments to kevglasses latest.

Enjoy,
Dr. A>

Oh, two player on the same machine :smiley: now thats slightly different. If I do two player it will be something I add after everything else is finished, there is still a lot to do and ideas for other games keep popping up :slight_smile:

It was broken before, but now it will tell you whether the audio was initialized whenever you run it. I was returning from the method if initialization failed so the println was never reached.

recharging shields
I donā€™t think Iā€™ll do this just because it seems like the game would get too easy. What I may do instead is add some shield powerups on particularly tough levels, or maybe a full recharge after certain levels (levels with bosses for example).

text is hard to read
yeah, I think Iā€™ll make that blue bar opaque, that should do the trick.

twinkling stars
I was thinking about this when I was making the background, but I came to the conclusion that the stars would not twinkle if you were in space. Then again just the fact that it occured to me shows that the user may expect this anway even if it is unrealistic. Certainly something needs to be done with the background, its a bit plain.

moving background
I experimented with this and I felt that it might cause motion sickness for some people. I could have a few different star sizes and have the bigger stars shift more and the smaller will do the opposite for a parallax effect. The reason I didnā€™t do this was because it seems like if the stars are the size that they are, they would appear to remain stationary unless your ship moved a VERY large distance. maybe some random planets or something could be added to the backgroundā€¦ I was planning on adding some objects that have gravitational pull in certain levels in adventure mode, but I havnā€™t thought of anything very good to add the default background.

Asteroids along the z-axis
The asteroids could use some kind of transition for when they appear, and increasing in size could be it. However this could also be used in game play, perhaps some levels will have objects flying from the distance into the foreground ( some garbage floating around in space or something ), this flying pieces could be blown up or maybe you just have to dodge them.

The shield
I think I am going to just have an auto-shield so I donā€™t complicate the controlls anymore ( it will start to be quite alot with reverse thrust and some kind of bombs ). The shield will last for a while and show itself when it as well as playing some low pitch sound. If your shield runs out then your ship flashes and your health starts lowering, the sound for this will be a bit more cacophonous so it feels like your ship is being destroyed (maybe youā€™ll start smoking too ;D ), your ship will only be able to sustain a couple of hits like this.

Wow, nice asteroid version. never hat that much fun on playing asteroids.
The adventure mode is cool, but will be boring after a time.
You might add powerups like timefreeze, which will freeze the asteroids movement for a short time.

@Flashlight: looks nice, but I was disapointed that my blasterballs donā€™t make any light at the point they are. Its really hard to find the asteroids only with the flashlight. Just a mention that the blasterballs might light the surrounding a bit would be nice.

Sound works and the exploding effects are really cool.

Having trouble running on Win2K with Intel 82845G/GL card:

An error occurred while launching/running the application.

Title: Asteroids
Vendor: Weston - Cyntaks
Category: Unexpected Error

Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: 0


net.java.games.jogl.GLException: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: 0

      at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:412)

      at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.create(WindowsOnscreenGLContext.java:211)

      at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:135)

      at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:110)

      at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:254)

      at net.java.games.jogl.GLCanvas.reshape(GLCanvas.java:112)

      at java.awt.Component.setBounds(Unknown Source)

      at java.awt.BorderLayout.layoutContainer(Unknown Source)

      at java.awt.Container.layout(Unknown Source)

      at java.awt.Container.doLayout(Unknown Source)

      at java.awt.Container.validateTree(Unknown Source)

      at java.awt.Container.validateTree(Unknown Source)

      at java.awt.Container.validateTree(Unknown Source)

      at java.awt.Container.validateTree(Unknown Source)

      at java.awt.Container.validate(Unknown Source)

      at java.awt.Window.pack(Unknown Source)

      at com.cyntaks.asteroids.DisplayManager.displayWindow(DisplayManager.java:185)

      at com.cyntaks.asteroids.MainClass.<init>(MainClass.java:143)

      at com.cyntaks.asteroids.MainClass.main(MainClass.java:164)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

      at java.lang.reflect.Method.invoke(Unknown Source)

      at com.sun.javaws.Launcher.executeApplication(Unknown Source)

      at com.sun.javaws.Launcher.executeMainClass(Unknown Source)

      at com.sun.javaws.Launcher.continueLaunch(Unknown Source)

      at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)

      at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)

      at com.sun.javaws.Launcher.run(Unknown Source)

      at java.lang.Thread.run(Unknown Source)

having the same problem with:

http://opensource.dazoot.ro/maze3d/documentation/demo.html#Demo

Evil-Devil: glad you liked it :slight_smile: adventure mode and deep space mode are far from finished, lots of ideas have already been posted. Yeah, it is hard to locate the asteroids with the floodlight alone which is why Iā€™m going to add sort of a light ā€˜shockwaveā€™ which Iā€™ve described in previous posts. As for adventure mode, its pretty empty right now, just the basics are available. There will eventualy be all kinds of powerups and hopefully some other neat features.

zparticle: Oh no, you have an Intel card! Wish I could help but Iā€™ve already posted on it in the jogl forums with no solution found, not to mention it looks like you are having the same problem with another jogl program :frowning: I gave a warning about Intel cards in my first post, but thats all I can do for now. Please let me know if you find anything out!

Bummer.

Is there any way you can avoid that particular OGL call? I donā€™t have problems running the Xith3D demos and they use JOGL.

It might be cause the pixel format youā€™re requesting asks for something the Intel integrated cards donā€™t haveā€¦ likeā€¦ um, well I donā€™t knowā€¦ Stencil Buffer?

Kev

zParticle: I will certainly do this if I can figure out which jogl call is making that call :wink: I never try to ā€˜enumerate pixel formatsā€™ in my code, so I suppose I must be using an ogl function that does.

Kevglass: Iā€™m not to my knowledge using a stencil buffer (since I donā€™t know what it is).

does anyone else know of an openGL call that would need to change the pixel format?

Edit: I just remembered that Iā€™m using a class I didnā€™t write: TextureLoader. I checked it out and sure enough this is the only place in my code where the word pixel format appears. Kev, you think it could be in here? (I ask since your the author ;D ).

Thatā€™ll be jogl code trying to search for a suitable display mode and having problems. When you create your OpenGL canvas try using a simpler set of values for the GLCapabilities object (like only 16 colour bits and no depth, stencil or alpha bits). IIRC you can just use the default GLCapabilities which will accept pretty much anything as a suitable canvas.

Ok, Iā€™m now creating my canvas like this:


canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());

hopefully that does the trick (new version uploaded).

it works on my computer. very good, i like it.

win2000
jre 1.4.1

INTEL Celeron4 2.0G
gf mx440
memory 256M
sound on board

Sound works, but it ā€œrunsā€ surprisingly slow. Less than one frame per second.

win98se, 1.4.2_05, k7 500, 128mb, gf2mx(32mb), opengl 1.3 compatible drivers.

And for being sure I just tested other opengl stuffā€¦ it still works fine.

hmm, I tested it on my schoolā€™s computers which also have geforce2 32meg cards ( and 2.1 ghz processors ), it seems to be running at about 5 frames per second. I assumed this was because their drivers were outdated since Alien Flux complained about card/drivers and wouldnā€™t launch. The first person that replied to my posts also has a geforce2 which the game ran on. Iā€™ll assume it was a 64 meg card since there werenā€™t any problems on it.

It would appear that the problem would be that I crossed some barrier and Iā€™m using between 33 and 63 megs of video memory so it works on the 64meg card but not on the 32. Iā€™m pretty sure Iā€™m not using anywhere near that though, after all there are only 200k worth of textures in the game. It sounds more likely that opengl is running in software mode for some reasonā€¦ Any ideas, anyone?

edit: typos.

200k worth of textures

Itā€™s moreā€¦ usually 1-4 bytes per pixel, but itā€™s of course not enough to eat up 32mb of ram.

I also think itā€™s software mode, but I donā€™t know why it was choosen.

My opengl stuff works, alien flux works, super elvis worksā€¦ and just for reference I also tried Kevā€™s JOGL space invaders (again) and it (still) works.
Odd. ???

Ok Iā€™m attempting to explicitly set the canvas as hardware accelerated. I was hoping that I could use the default canvas and get it working on Intel cards (still donā€™t know if that worked), but if looks like I may need this to get hardware acceleration on some cards.


GLCapabilities caps = new GLCapabilities();
        caps.setHardwareAccelerated(true);
        caps.setDepthBits(0);
        caps.setStencilBits(0);
        caps.setRedBits(16);
        caps.setGreenBits(16);
        caps.setBlueBits(16);
        canvas = GLDrawableFactory.getFactory().createGLCanvas(caps);

Thats what my initialization code looks like now.

Onyx: could you give the new version a try? thanks.

Triedā€¦ 83kb or so asteroids.jar got loadedā€¦ still the same :-/

caps.setRedBits(16);
caps.setGreenBits(16);
caps.setBlueBits(16);

uhmā€¦ 16? 48bit?! ??? (shouldnā€™t that be 8?) :>

48 bits :-[ oops

Iā€™ll have to see if I can mess around with my schools computers and see if I can get it working on their geforce2 32meg cards. If I do get it working, Iā€™ll post it here. Thanks for your help onyx.

Iā€™m back to using the default GLCapabilities since that didnā€™t work (hopefully this fixes the intel card problem).

I made the stars a bit smaller, added ship and asteroid transitions for when they first appear, and added a ā€˜poisonā€™ effect for when you get shot by a UFO.

No go, same error. Thanks for trying.

Updated my drivers, the window now shows up but it never draws anything, just a black screen.