Shoot em up hack

Hi there, here’s a little hack of a shoot em up I’ve been working with for a couple of days. Being a hack, I just realized how stupid the implementation of shooting is in the game. So the next thing to do is to refactor that part, until then the boss at the end of the level is pretty lame :smiley:

Suggestions and bug reports are most wellcome.

Game Controls
Steer with cursor keys
Fire with Z
Use smartbomb with A
Use shield with S

http://enormousgames.com/subsites/spaceshooter/spaceshooter.jnlp

java.lang.NullPointerException
at com.enormousgames.gfx.activerenderer.logic.ActiveRendererSpine.start(ActiveRendererSpine.java:119)
at com.enormousgames.projects.spaceshooter.SpaceShooter.main(SpaceShooter.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:837)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:797)
at com.sun.javaws.Launcher.continueLaunch(Launcher.java:675)
at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:390)
at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:199)
at com.sun.javaws.Launcher.run(Launcher.java:167)
at java.lang.Thread.run(Thread.java:534)

Dang!
It’s the display mode that is null. I thought I’d covered everyone with this list.

DisplayMode[] dm = new DisplayMode[]{
new DisplayMode( 1024, 768, 32, 72 ),
new DisplayMode( 1024, 768, 24, 72 ),
new DisplayMode( 1024, 768, 16, 72 ),
new DisplayMode( 1024, 768, 32, 60 ),
new DisplayMode( 1024, 768, 24, 60 ),
new DisplayMode( 1024, 768, 16, 60 )};

I dont know if you can cover everyone at 1024… maybe add an 800x600 and a fallback 640x480?

That being said, it worked fine for me… however that “fade in” and “fade out” screen at the beginning took what seemed like forever. Probably close to a minuite. I almost quit while waiting for it. maybe it’s supposed to fade in all fast and such, but I would remove it. Especially now since your game isnt commercial or whatever.

I think people want to get right to the game… I did like the nice menu screen after that however.

Game has some really cool potential!

Dear Dr,

The game does not appear to work on my system:

Win XP (SP1)
Java 1.4.2_04-beta5
PIII 1GHz
Geforce2 MX 64MB
1600 x 1200 @ 85Hz

Symptom:

Game very slowly fades into view, finally entering the menu selection screen. Nothing else happens, there is no cursor feedback. I could go no further. :frowning:

Very true regarding the fade in fade out stuff, even though it isn’t supposed to be that slow, it’s pretty redundant and it’s pretty removed now :P.

As for fallbacks to lower resolutions, I don’t now. You can’t fit the game in lower resolutions. I could make the game resize all images in the game to fit the resolution, it wouldn’t be to much of a job, even though there’s some stuff that is hardcoded right now :), and I guess it would look ok. Only time will tell I guess :wink:

…Actually,

It does seem to work if you follow SpuTTers advice and are patient for a minute or two.

Although, I think the root of the problem may be some to do with a java webstart window that pops up for a split second (whilst changing to fullscreen mode) asking if you would like to add this application to the desktop. It quickly disappears, and the game goes straight to the menu screen (from the second time launched and onwards).

Hope this helps!

ribot: thanks for the info, I’ve disabled that feature in webstart and totaly forgotten about it. But I have no idea on how to solve it. The problem is that the question window that pops up behind the fullscreen window gets keyboard focus. Any suggestions for workarounds? ???

Just make sure and hit Y or N real quick to answer the desktop integration question.

If you miss it, you can alt-tab out and answer it. I did this with your game however, and it wouldnt come back after the alt tab. So I answered the question and then restarted it.

Works…

Thanks for removing the fading, its quick now :slight_smile:

Not sure about workarounds as I don’t have much experience with webstart. The desktop integration window defaults to the “ask later” button, so you can press enter to an invisibly focused button and the game will continue perfect from then on…

…In-game, everything seems to work fine…nice framerate, no graphic problems… I did find one slight bug though: When you wish to change the direction of the ship (say from left to right), when you pressing the right arrow key, there is quite a sustantial pause (100-400ms? maybe more) before the ship follows this new direction. Maybe logic timesteps are too far apart?

[quote]Dang!
It’s the display mode that is null. I thought I’d covered everyone with this list.

DisplayMode[] dm = new DisplayMode[]{
new DisplayMode( 1024, 768, 32, 72 ),
new DisplayMode( 1024, 768, 24, 72 ),
new DisplayMode( 1024, 768, 16, 72 ),
new DisplayMode( 1024, 768, 32, 60 ),
new DisplayMode( 1024, 768, 24, 60 ),
new DisplayMode( 1024, 768, 16, 60 )};
[/quote]
Sigh. Your fallback should include “accept ANY refresh rate for the desired resolution”.

Also, given the massive number of people with LCD’s, you should NOT be trying to fix the resolution. It pisses people off when your game appears tiny in the middle of their screen (default mode for many LCD’s: one pixel per pixel, so a 1600x1200 LCD will just have a huge black border 300 pixels wide around your game).

In my case, I’m using an LCD on linux. My refresh rate is 0Hz. But this really shouldn’t be an issue - as I said, you need to accept any refresh rate if you can’t find one you like.

Doesn’t work.

Screen mode left unchanged… programm starts anyways… everything is somewhat “off”… I click on start… black screen with red text and that’s it.

Waited several minutes… nothing happened. Tried exiting with esc… didn’t worked… alt+tab… ctrl+alt+del -> kill.

Hmmm, I canceled the download when webstart said:

Requesting JRE 1.4.0 from java.sun.com

Wooo, sounds like I should name the game trouble o mania instead hehe.

SpuTTer: Yeah I know I don’t handle tabing in and out of the game. Have simply been to lazy to find out how it’s done.

blahblahblahh: ok, think I’ve fixed so it picks the highest refreshrate available. As for the resolution that will have to wait for later.

oNyx: That black screen with redtext is visible when the level is loading, at the bottom of it should a text pop up saying “press fire to play” when the level is loaded. I have changed that to press any key instead now.

Mojomonkey: I have 1.4.0 stated in the jnlp, but I thought that only was the minimum requirement. I know for sure that I only have 1.4.2_04 and 1.5b1 installed on my machine and that it dosen’t try to download 1.4.0 when i play. Guess I’ll have to dig a bit deeper into jnlp docs, or does anybody have any hints regarding that matter?

1st run, it got to the ‘storm clouds are gathering’, did several of the loading yellow squares then bombed out. (console vanished too, so I can’t give you a stacktrace.)

2nd and all subsequent times(so far) it works, but doesn’t change resolution.
(it stays at my desktop res of 1152x864, with an ugly border around the right & bottom edges - a border that gets filled with hal or mirrors, and unclipped drawing)

Why don’t you prompt the user for what resolution they want? (from the list of available)

The controls are horrible too - almost like you are doing something more than setting a flag in the keyListener.
(i.e. game logic - which should never be in a keyListener)

oh yeah, and minor point - you can die after respawn, when you are stilled faded (which I assume is meant to mean you are invulnerable)

[quote]ok, think I’ve fixed so it picks the highest refreshrate available.
[/quote]
This might cause trouble as some cards will report refreshrates that the monitor can not handle. The safest thing is to use the lowest refreshrate available.

Thank you for all comments.

Abuse: I have no idea what could have caused the crash in the first run, so that will have to remain a potential crash point ;).

Think I’ve solved the other problems now though.

The not changing resolution bug might have been related to the problem tom pointed out in the post after yours.

The controls where whacky due to me setting the x-vel val to 0 when the left or the right key was released (and the same for up/down keys). I’ve added a check so it only does that if the ship is travelling in the keys direction. Made the controls alot nicer, thanks a ton for the pointer.

The respawn thing was probably due to the ship changing back to the normal visual look at the same moment as the ship changes back to vulnerable mode. I’ve made a temporary sollution and made the visual go back before the acctual ship mode. Will add a flashing visual look or something later on to indicate the ship is becoming vulnerable again.

As for leting the player choose resolution stuff from a list. Since most people playing my games are avarage Joe, or acctually avarage Mary, kind of people I want the game to just start.

Tom: Thanks for the info, I think that acctually caused some troubles.

[quote][…]
oNyx: That black screen with redtext is visible when the level is loading, at the bottom of it should a text pop up saying “press fire to play” when the level is loaded. I have changed that to press any key instead now.
[…]
[/quote]
Well, as I said, no screen mode change and everything was off. So if there was something on the bottom, I wouldn’t have been able to see it.

However, I tried shift, ctrl, return, space, mouseclick etc - nothing happened. I should have tried ‘z’ huh?

Yes indeed, you should!!!1 ;D hehe yeah I know pretty stupid to only accept an unobvious key at such a screen. Any way it accepts any key now so I guess anybody but Homer Simpson will be able to play the game. 8)

What was that about Homer?

Dude, you seriously need to fix your use of null references! Time to learn “defensive programming” perhaps?