Attack of the Green Aliens 2

Hi JGO!

I’ve been working on this for a bit and it’s in a playable state now.

The gameplay is simple, don’t get hit and kill the enemies. Not much has been implemented yet and there are only three waves, but you can add more by adding files to leveldata/waves.
Controls are arrow keys to move, shift key to go slowly. Q, W, and E show debug stuff.

Requires OpenGL 3.3 and ARB Sample Shading.

Download

This is number 2 because I already made one before it ~1.5 years ago, but it wasn’t very well designed. Might be a little generic but I’m not a super-creative guy.

Feedback is greatly appreciated!

By the looks I’d imagine it would get action-intensive. To some extent it reminded me of DemonStar 2. Would love to give it a try if it could actually start.

I am using MacBook Pro Retina, Mid 2014 model running Yosemite 10.10.5 with JDK1.8.0_u60.
The VM crashes while launching through the thing.sh script.

Tracing through the heap space crash log dump, it seems to be a problem with liblwjgl.dylib. Similar situations have occurred previously on earlier versions of LWJGL on JDK1.7, so it’s not your game’s fault. I’ll just have to wait and see others’ replies.

I tried to start it but it instantly crashes with this error:


C:\Users\faust\Downloads\Attack of the Green Aliens 2>java -Djava.library.path=n
ative/ -jar Space-Shooter.jar
java.util.InputMismatchException
        at java.util.Scanner.throwFor(Unknown Source)
        at java.util.Scanner.next(Unknown Source)
        at java.util.Scanner.nextFloat(Unknown Source)
        at minusk.space.level.LevelController.parseWave(LevelController.java:123
)
        at minusk.space.level.LevelController.initialize(LevelController.java:45
)
        at minusk.space.Space.initialize(Space.java:42)
        at minusk.render.core.Game.gameloop(Game.java:27)
        at minusk.space.Space.main(Space.java:94)
java.util.InputMismatchException
        at java.util.Scanner.throwFor(Unknown Source)
        at java.util.Scanner.next(Unknown Source)
        at java.util.Scanner.nextFloat(Unknown Source)
        at minusk.space.level.LevelController.parseWave(LevelController.java:123
)
        at minusk.space.level.LevelController.initialize(LevelController.java:45
)
        at minusk.space.Space.initialize(Space.java:42)
        at minusk.render.core.Game.gameloop(Game.java:27)
        at minusk.space.Space.main(Space.java:94)
java.util.InputMismatchException
        at java.util.Scanner.throwFor(Unknown Source)
        at java.util.Scanner.next(Unknown Source)
        at java.util.Scanner.nextFloat(Unknown Source)
        at minusk.space.level.LevelController.parseWave(LevelController.java:123
)
        at minusk.space.level.LevelController.initialize(LevelController.java:45
)
        at minusk.space.Space.initialize(Space.java:42)
        at minusk.render.core.Game.gameloop(Game.java:27)
        at minusk.space.Space.main(Space.java:94)
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
        at minusk.space.level.LevelController.update(LevelController.java:72)
        at minusk.space.Space.update(Space.java:76)
        at minusk.render.core.Game.gameloop(Game.java:41)
        at minusk.space.Space.main(Space.java:94)

Nibby: I uploaded this kinda late last night, and I forgot to put in all the scripts. I updated the download to have a mac.sh script now.

Amryu: My best guess is that in your locale decimals are not separated by . and I didn’t set a locale in the Scanner I was using. I now set it to use Locale.US, so it should work for you now.

Yes that could be it. I’m living in germany and here you seperate with “,”.

This should work then^^

EDIT: Works now. Runs smooth, but the difficulty from the one wave (that is shooting millions of lasers) is
waaay too high if you really want to kill all of them. Maybe you should add more waves and make use of the
money somehow next^^

Nice game though

Greetings

The wave that shoots all of those lasers is completely unbalanced, but it’s not really intended for you to kill all of the enemies. I’m not sure what exactly I’m going to add in the next update, but hopefully money will be useful by then. Also, you can go into the files in leveldata/waves and edit/add/remove them to change the waves that show up in the game.

Re-downloaded the game files again and tried running it (using mac.sh). A long window showed up, but the screen is completely black. I’ve also noticed that I am unable to exit the window normally by clicking the close button. Nothing is rendered on screen.

Try again now, but I don’t own a Mac and so can’t find the problem myself. If this doesn’t fix it, I don’t know what will.

Still no luck… I think it’s a LWJGL native thing.

Did you try to add the console first and executing the command manually,
so you actually can see the error? I don’t know how it works on Mac but
you can’t see the error if the cmd (or whatever it is called in Mac) closes
instantly. Please post the error here if you can find it.

Greetings

Tested on mac, just getting a blank black window which is frozen, theres no output on the console. Maybe put in a few System out’s to help determine how far it gets in before the freeze. Since there is a window unlikely to be a LWJGL natives issue.

EDIT: Adding the lwjgl 3 debug flag (-Dorg.lwjgl.util.Debug=true), I am able to see an exception in the console as follows:

./mac.sh
[LWJGL] Version 3.0.0b | Mac OS X | x86_64
[LWJGL] MemoryUtil MemoryAccessor: MemoryAccessorUnsafe
[LWJGL] Failed to locate address for GL function glProgramUniform1dEXT
[LWJGL] Failed to locate address for GL function glProgramUniform2dEXT
[LWJGL] Failed to locate address for GL function glProgramUniform3dEXT
[LWJGL] Failed to locate address for GL function glProgramUniform4dEXT
[LWJGL] Failed to locate address for GL function glProgramUniform1dvEXT
[LWJGL] Failed to locate address for GL function glProgramUniform2dvEXT
[LWJGL] Failed to locate address for GL function glProgramUniform3dvEXT
[LWJGL] Failed to locate address for GL function glProgramUniform4dvEXT
[LWJGL] Failed to locate address for GL function glProgramUniformMatrix2dvEXT
[LWJGL] Failed to locate address for GL function glProgramUniformMatrix3dvEXT
[LWJGL] Failed to locate address for GL function glProgramUniformMatrix4dvEXT
[LWJGL] Failed to locate address for GL function glProgramUniformMatrix2x3dvEXT
[LWJGL] Failed to locate address for GL function glProgramUniformMatrix2x4dvEXT
[LWJGL] Failed to locate address for GL function glProgramUniformMatrix3x2dvEXT
[LWJGL] Failed to locate address for GL function glProgramUniformMatrix3x4dvEXT
[LWJGL] Failed to locate address for GL function glProgramUniformMatrix4x2dvEXT
[LWJGL] Failed to locate address for GL function glProgramUniformMatrix4x3dvEXT
[LWJGL] Failed to locate address for GL function glVertexArrayVertexAttribDivisorEXT
[LWJGL] Failed to locate address for GL function glTextureStorage1DEXT
[LWJGL] Failed to locate address for GL function glTextureStorage2DEXT
[LWJGL] Failed to locate address for GL function glTextureStorage3DEXT
[LWJGL] Failed to locate address for GL function glVertexArrayVertexAttribLOffsetEXT
Exception in thread "main" org.lwjgl.opengl.OpenGLException: Cannot use offsets when pixel unpack buffer object is disabled
	at org.lwjgl.opengl.GLChecks.ensureBufferObject(GLChecks.java:26)
	at org.lwjgl.opengl.GL12.glTexImage3D(GL12.java:210)
	at minusk.render.graphics.globjects.SpriteSheet.<init>(SpriteSheet.java:39)
	at minusk.space.entities.Entities.initialize(Entities.java:45)
	at minusk.space.Space.initialize(Space.java:41)
	at minusk.render.core.Game.gameloop(Game.java:27)
	at minusk.space.Space.main(Space.java:94)

The problem might be that you haven’t specified forward compatibility mode, if you wish to use an OpenGL 3.x or 4.x context on OS X you have to enable forward compatibility and the core profile context, its an OS X requirement. Details on how to do this with LWJGL3/GLFW are available here.

Strange, I do specify core profile and forward compatibility. Here’s the hints I’m creating the window with:


glfwDefaultWindowHints();
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);