ScorpionHunter - A SilenceEngine Demo game

Hello everyone,

It’s been a long time since I started SilenceEngine (one month actually), but I’m now very happy to show you the first demo made using SilenceEngine. It is now feature complete for 2D, it has got automatic collision detection, sound, truetype fonts, etc., all the things I have planned for 2D are now complete, and here is the demo game I made.

This game is a top-down shooter where you are a shooter (obviously!) and you have to shoot Scorpions for the sake of protecting your friends whom you have never seen! Just kidding, there is really no story here, it’s just a game, I made it to test the abilities of SilenceEngine. Here are some more screenshots about the game.

http://puu.sh/dToA5/0339f2b1f5.png

http://puu.sh/dTqyr/5778b4af24.png

http://puu.sh/dTqJt/47d5a369ad.png

As per the other details, this game will be used as a demo, and also as a tutorial for my engine, the source code is on GitHub here. In this game, I show the following features of the SilenceEngine.

  • Collision Detection through Scene Colliders
  • Camera and the movement
  • Scene Management
  • Resource managing
  • Infinite Scrolling Map

Though I said those in the above feature list, actually, all the above things will be managed by SilenceEngine for you. Though I said it will be a demo game, I won’t stop with this here, I will continue to work on it, I still have to add some story screens and some powerups, etc., hence I am posting this in the WIP section.

You can download the game here, and you can see the source code in my GitHub repository here..

By the way, Happy New Year everyone!!

The demo did not run on my computer.

That’s a new bug! What card are you using? I think it is because I used the same name for input texcoords in vertex shader and for sampler2D in fragment shader, but clearly, it is not uniform in both shaders.

I’ll try to get a new build, thanks for spotting it.

Microsoft Surface with an Intel i5-3317U 1.7GHz and integrated Intel HD 4000 Graphics. I’ll try to test it on my desktop with an NVidia card when I get home.

@Elsealabs

Please retry again, I have updated the download link. http://goharsha.com/downloads/tafsj/ScorpionHunter.jar

Is this using Java 8?

Yes, I have been using Method References and Lambdas in writing GLFW callbacks.

Explains this :stuck_out_tongue:

http://s7.postimg.org/ag9npqpt7/Error.png

I hope you are not aiming for android support in the future lol.

Run java -version and see what it says. You may not be using the JRE you think you are.

I only have Java 7 installed, revision 55.

Well there you go.

Unfortunately I don’t think Java 8 has been around long enough yet to be feasible for libraries.

I don’t think I’m going back to Java 7, because some of the SilenceEngine is made with Method references in mind. For example, I use this code for the [icode]GameTimer[/icode] instances.


private void timerTick()
{
    // Do something here
}

GameTimer timer = new GameTimer(10, TimeUtils.Unit.SECONDS);
timer.setCallback(this::timerTick);
timer.start();

Although it is possible to convert this back into anonymous classes, in my opinion, method references make it a lot easier, and it also looks clean and neat. And yes, I’m not having any plans for porting to Android anytime soon, this is not even complete, and is not usable for production quality games, maybe I will think about that when Java 8 becomes the standard.

Nice demo. It was pretty smooth but felt a slow. The rotation was a bit too slow for my taste and I thought the scorpions should spawn a little more progressively. Also, when you shoot, I notice a small red line behind the gun.

PS: what is that on the player’s head?

The game speeds up slowly, in the starting, scorpions are spawned every 10 seconds, but slowly, the spawn time decreases to a maximum of 2 seconds, one spawn every two seconds.

I never created spritesheets before, it was an error in the spritesheet, the blood cell moved a pixel upwards in the sheet. I’ll fix that soon.

Since I’m not a very good artist, I modeled these sprites in Blender. The spot on the player head was the light in the Blender scene. If I took out the light, then blender was rendering complete black, so I kept it there.

You can turn down specular in the materials tab if you’re using Blender Render

I have updated the game with a lot of changes, mainly the update to the SilenceEngine to version 0.0.2 using LWJGL Nightly #37. Here is a list of changes.

  • Fixing the collision detection, the bounding boxes are made tighter.
  • Moved the entire mess of code into game states. This is a new feature in the Engine itself.
  • Fully commented the source code. Now the comments take up 26% of the entire source code.

According to the Statistics plugin of IDEA, the game is done in only 548 lines of code, ignoring the comments and blank lines. I’m pretty much sure that the engine is now usable for any type of 2D game. My next game, a platformer is also coming nice, will post it here in a few days.

Here is the updated link to download: http://goharsha.com/downloads/tafsj/ScorpionHunter.jar (4.73 MB, Java 8 required)

Any ideas to improve this game are welcome :wink:

Hey SHC!

I’ve downloaded your game but it wont start. This is my output:

[INFO 02/01/2015 9:11:36 AM] Initializing SilenceEngine version 0.0.2
[INFO 02/01/2015 9:11:37 AM] Starting to load natives
[INFO 02/01/2015 9:11:37 AM] Natives loaded successfully
[INFO 02/01/2015 9:11:37 AM] Initializing Display
com.shc.silenceengine.core.SilenceException: com.shc.silenceengine.core.SilenceException: 65544: GLX: Failed to create context: GLXBadFBConfig
	at com.shc.silenceengine.core.Display.lambda$create$3(Display.java:211)
	at com.shc.silenceengine.core.Display$$Lambda$1/189568618.invoke(Unknown Source)
	at org.lwjgl.glfw.GLFW$1.invoke(GLFW.java:2661)
	at org.lwjgl.glfw.GLFWErrorCallback.callback(GLFWErrorCallback.java:42)
	at org.lwjgl.glfw.GLFW.nglfwCreateWindow(Native Method)
	at org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:1004)
	at com.shc.silenceengine.core.Display.createWindow(Display.java:128)
	at com.shc.silenceengine.core.Display.create(Display.java:219)
	at com.shc.silenceengine.core.Game.start(Game.java:171)
	at com.shc.scorpionhunter.ScorpionHunter.main(ScorpionHunter.java:178)

	at com.shc.silenceengine.core.Game$1.uncaughtException(Game.java:73)
	at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1057)
	at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1052)
	at java.lang.Thread.dispatchUncaughtException(Thread.java:1952)

I’m running Ubuntu 14.04 LTS. I have a Intel Mobile 4 Chipset graphics card, 3GB ram and I’m using the JDK 8 x64.

@TheBoneJarmer

It doesn’t seem that OpenGL 3.3 is available on your system. The stackstrace says that the exception is caused from internal to GLFW.

Yes that is true. My graphics card supports OpenGL 2.1. But GLFW works fine in my engine. So it cannot be the source of the problem. Which means it has to do with the GL33 methods in your code. I do not know which one they are but are they ommittable?

@TheBoneJarmer

GLFW is actually the Windowing and Context management library. Unfortunately, I use a lot of GL33 calls in my game engine, and it is one of the features of SilenceEngine. I’m sorry, I don’t plan to support old hardware.