Share My Creation Invaders!

May I present my space invaders style game written using B4A and LibGDX.

https://play.google.com/store/apps/details?id=uk.co.coffeeinducedgames.invaders

2014-04-23 10.38.38.png 2014-04-23 10.38.29.png

Please give me some feedback and ideas for improvements or bugfixes.

It should run very smooth on most devices but I'm interested to hear if anyone has any device where it runs slowly at all.
 

andymc

Well-Known Member
Licensed User
Longtime User

capisx

Member
Licensed User
Longtime User
Runs really smooth on Galaxy Tab (Gingerbread) and Nexus 5 (Kitkat). Why you don't put a pause button or pause when user hit back button while playing? Storing the highscore and adding Online Highscore will be even better.

Two 5 star from me :)
 

andymc

Well-Known Member
Licensed User
Longtime User
I've added death animations for the aliens and the flying saucer. The play store apk should update in a few hours

I'll try to add the highscore table and score sharing next

I would like to add some more polish to it but I'm not an artist, so it has that amateur look to it.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It crashed today with the following error:
temp read as 11
received
** Activity (main) Pause, UserClosed = false **
paused
sensor listener tear down
** Activity (main) Resume **
sensor listener setup
resumed
java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
at java.util.ArrayList.remove(ArrayList.java:403)
at anywheresoftware.b4a.objects.collections.List.RemoveAt(List.java:104)
at uk.co.coffeeinducedgames.invaders.main._lg_render(main.java:1698)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:174)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:162)
at anywheresoftware.b4a.libgdx.LibGDX$LibGDX_Listener.render(LibGDX.java:117)
at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:393)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
** Activity (main) Pause, UserClosed = true **
waiting for pause synchronization took too long; assuming deadlock and killing

Suggestion: Allow playing with one hand by adding an auto-fire option.
 

andymc

Well-Known Member
Licensed User
Longtime User
Thanks erel, there's quite a few loops through lists in the game so it may take me a while to find the bug.

In the meantime, I've added the back button option in game that people have requested and fixed the bugs concerning the music starting when it shouldn't and improved the menu graphics.
 
Last edited:

Beja

Expert
Licensed User
Longtime User
Thanks Andy in advance.. will try it tonight..
Also thanks for the code.. you posted it for everyone, not just licensed members.
 

Beja

Expert
Licensed User
Longtime User
5 Stars..
Thanks Andy for a great game from the good old days! I remember I played this game in 1980 in Brooklyn, and almost addicted to it.
It was embedded in slot machines with Z-80 CPUs. You must have dug deep to find it..
 

andymc

Well-Known Member
Licensed User
Longtime User
I've updated the game to fix a few bugs and also re-arrange the code to make it easier to read. I've split the main game loop code into updating, then drawing. This is a better way to organise the main game loops as it allows you to focus on the objects when they get updated and not worry about drawing them. You can also draw things in any order you like without worrying aboout which objects affect each other.

Anyway, the play store should give you an update today, the only things yoou'll notice in the game are changes in the button sizes on the main menu and the aliens now speed up slightly for each level you complete.

I also fixed a bug where the bases would start disintegrating even when you'd killed the bottom row of aliens.

I want to implement a highscore system next. I can write a highscore table ingame, but is there a good library I can use to upload to google play service or scoreloop?

Lastly, I have got a banner ad in the game, which I hope people don't mind. But when the game gets more popular, and I write more games, I want to know what adverts work best for people here? In terms of generating revenue?

The source code link is: https://dl.dropboxusercontent.com/u/8673694/my games/Invaders-source.zip

And the play store link is: https://play.google.com/store/apps/details?id=uk.co.coffeeinducedgames.invaders


People have recommended features such as Auto-fire, left and right hand controls, and a landscape mode option, I will look at these soon.
 

andymc

Well-Known Member
Licensed User
Longtime User
I fixed the bug where the game crashes when shooting the flying saucer, the bug was that it was iterating through the list of bullets but went out of bounds when only one bullet was on screen and hit the saucer, the game removes the bullet from the list but then tries to load the next item in the list, which crashes things. I fixed it by exiting the loop if that happens but will tidy it up later.
 

CyclopDroid

Well-Known Member
Licensed User
Longtime User
Excellent but, if you moves to the right of screen and hold down fire button alwais, the alien fire not have effect... this passing through you and not dead.
Continuing to press the fire, the speed increases so much but the fire bullets, it has a continuous line....and the aliens dead immediately.
At the 38th level, the app is blocked and terminate with a message :(
Sorry for my bad English.
 

andymc

Well-Known Member
Licensed User
Longtime User
Thanks for your comments erosmax, I am working on the level balancing now, the game works well for the first few levels, but as you say, when you get to higher levels the ship fires much faster than the aliens and makes the game easier rather than harder. I'm not sure why the app terminates at level 38 but I would imagine it's because it tries to set a countdown to less than zero or generate an infinite amount of bombs. I will continue to work on balancing the game and will publish an update later this week. I am also adding in bonus drops from the aliens, such as extra lives, double fire, speed and re-generate bases.
 

andymc

Well-Known Member
Licensed User
Longtime User
I just wanted to say thank you for all the feedback guys!

I've decided to take a break from this game for now and am writing an endless runner game that I hope to finish in a few weeks time.

I will come back to developing this game sometime in the fuiture, and then either update it, or release a sequel with elements of Galaga thrown in, different aliens, weapons, etc...
 

eps

Expert
Licensed User
Longtime User
Has anyone managed to get the source code (kindly) offered by andymc to generate and execute? I can't seem to get it to execute without erroring - something about a bm_font_4 file and I can't seem to work out where the error is! Is it likely to be in a library - maybe I've got an old version or something?
 

Beja

Expert
Licensed User
Longtime User
Yes, today I tried the project from post #29 and got the following error:

Parsing code. 0.06
Compiling code. Error
Error compiling program.
Error description: Missing parameter.
Occurred on line: 167
surface = lGdx.Initializeview("LG")
Word: )
 

eps

Expert
Licensed User
Longtime User
Hi Beja, that's not the error I get... I can compile but it errors on execution. An 'invaders has stopped unexpectedly' error.
 

ilan

Expert
Licensed User
Longtime User
Has anyone managed to get the source code (kindly) offered by andymc to generate and execute? I can't seem to get it to execute without erroring - something about a bm_font_4 file and I can't seem to work out where the error is! Is it likely to be in a library - maybe I've got an old version or something?

there is a missing bmfont file ->

fixed source code here you go: https://drive.google.com/file/d/0B2eRQD9TJiOQME44V1JNY2xmZW8/edit?usp=sharing

Yes, today I tried the project from post #29 and got the following error:

Parsing code. 0.06
Compiling code. Error
Error compiling program.
Error description: Missing parameter.
Occurred on line: 167
surface = lGdx.Initializeview("LG")
Word: )


u are using the old LibGDX update to the new one and try the fixed source code i posted
 
Last edited:
  • Like
Reactions: eps

eps

Expert
Licensed User
Longtime User
there is a missing bmfont file ->

fixed source code here you go: https://drive.google.com/file/d/0B2eRQD9TJiOQME44V1JNY2xmZW8/edit?usp=sharing




u are using the old LibGDX update to the new one and try the fixed source code i posted

Ilan, thankyou! How did you work out the font was missing, I mean I could see that it was missing but when I duplicated one of the font files it then complained about another one... So I thought that this wasn't the issue. I'll try your code, thanks for sharing. Were there any other changes you made to the code? I'm trying to understand the code so that I can work out a way of coding my own game..
 

ilan

Expert
Licensed User
Longtime User
it was written the the log (run in debug mode) : cannot read from bmfont_new4 but there is no bmfont_new4 in directory files that means the file is missing :D

so i used the old bmfont
i didnot change anything else only disabled admob, it should not be hard to understand the code andymc write a nice and clear code also with explainetion so you just need always make a small change and see how it effects on your game like this you will learn the code very easy

Good Luck ;)
 
Top