Hi Guys, this time I am back with some Android Game Development. I got this idea after, the popular game Flappy Bird. Hope all may have tried that game…!
Ok, so I wanted to develop a game and I did some researches and found out that there are a lot of Game engines out there. Some of them are COCOS2D, AndEngine, libGDX and many others. In this article I’ll guild you using AndEngine which is a bit easier one. In future I’ll write on libGDX.
Assumption : I assume that you guys know how to install eclipse development environment, configure java path and install Android plugin to eclipse. This post does not cover all those basic steps.
Advise : As this is a kind of a crash course, its advisable to create files the same name as I use(But it is not mandatory).
Expected Outcome : You will be able to create some lines using the AndEngine
Download the Source(library) for the AndEngine using this link and extract
You can check it by right clicking on the project we created now and going to the Android tab. You can see the ‘Is Library’ check box ticked.
In my case package name is ‘”com.batz.andengsample”‘
Now in side the empty package Download or copy the code and create LineEample.java activity using this LineExample Source Code.
You will get some errors, but don’t worry we will fix it in the next step.
So now in your project, right click and go to Android tab and there in the below section(library section), click on the add button and select the AndEngine project and press ok. And then press Apply.
Now all the errors may have gone. Some times you will have errors on the package name, if you have used your own name. So for that, click on the package name that shows as error, click ctrl key +1 key , which will bring suggestion to create a package name according to yours, and click on it to create it. And hopefully all the bugs will be fixed.
Before going for the app launch, we have to do one more important thing, we have to specify the activity we created now in the manifest file as a launcher
So go to the manifest file and add these lines between the application tags
LineExample is the name I gave for the activity we created, so in your one don’t forget to change that
Now you are ready to run the app. So while you are in the the activity try running the app. it should bring a screen where you will see lots of random lines.
Step 8(For people getting error saying cannot find andengine.apk)
For some people the AndEngine folder is not getting added as library on the time of building the app. So at that point what you can do is copy the andengine.jar file from the AndEngine project libs folder and copy it into your projects’s libs folder. And right click on the newly added andengine.jar file and click on ‘Add to Build Path’ option. This is how the project structure looks after I added the jar to my project from the AndEngine project in the Step8
AndEngine Resources : http://www.andengine.org/
For people who got more time , for people who needs more detailed instruction on the same project guild please watch this tutorial video
Development Reference : http://www.youtube.com/watch?v=Q0kjiIH6u-M