Flappy Bot
An Obstacle Avoidance Game
This is a template for an obstacle avoidance game. The aim of the player is to move up or down the character, keeping it away from obstacles, by touching the screen. Thanks for buying this template! Hope you have as much fun customising it as I did building it.
Step by Step Customisation
Step 1 - Make sure you have Eclipse with the latest Android SDK installed on your system.
Step 2 - Import the 'Code - Import me' file into Eclipse. (2 files should be imported: facebook SDK, Flappy Bot)
Step 3 - Replace any PlaceHolder Sounds and Images
In Eclipse Make Sure to Change any images and sounds. The sounds used in this App are just placeholders. These are the sounds used:
- Falling - http://audiojungle.net/item/percussive-drum-fall-ding/5013177
- Coin - http://audiojungle.net/item/collected-coin/5031219
- music - http://audiojungle.net/item/crazy-birds/5445594
To replace the images and sounds just drag and drop your new images in res/drawable and your sounds in 'res/raw'.
Step 4 - Make sure to rename the App Package id
This needs to be done in AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourcompany.AppName"
android:versionCode="1"
android:versionName="1" >
Step 5 - Create a Facebook App (for Share feature) and put the Facebook App Id in the Strings.xml file.
You need to sign in as a facebook developer and create a new Android App for the share feature. Goto https://developers.facebook.com/docs/android/getting-started#samples for more details.
Step 6 - Create an interstitial Ad on AdMob and paste the AD unit Id in the Strings.xml file.
The Add displays once before gameover. Make sure to add this to start making money from your App.
Step 7 - Export your App as a .APK for Google Play
If you should encounter any errors during export, click on project and remove the 'Build automatically' then clean your project, build it and export it.
Step 8 - The App should now work but Facebook Share feature will still not work. You need to give facebook the App's hash key.
To Give Facebook your hash key, Just run the .Apk file on an Android device connected to your Computer and with LogCat (in eclipse) make sure to catch the following log when the app starts:
Package name: com.neurondigital.flappybot Key Hash for facebook:XXX+XXXXXXX+XXXXXXXXXX=
The 'XXX+XXXXXXX+XXXXXXXXXX=' should be your App's hash key which you should add to your Facebook App. For more details on this topic look at facebook's detailed explanation:https://developers.facebook.com/docs/android/getting-started#troubleshooting
Personalising App
Change Package Name
The first thing you should change is the package name. So, in eclipse, rename 'com.neurondigital.FlappyBot' under src to your own package name ('com.<companyname>.<appname>'). Eclipse should automatically update all pointers to that package name. Remember to also change the package name from the AndroidManifest.xml file.
TODO
In the code you will find TODO tags. Make sure to check them out. They indicate the places that you usually need to change something.
Modifing Obstacle Columns PositionsOpen MainGame.java in eclipse and go to line 107:
final float column_positions[][] = new float[][] {
//{X coordinate of column, Y Coordinate of hole, where 0.5f is center of screen}
{ 600, 0.5f },
{ 900, 0.3f },
{ 1200, 0.2f },
{ 1500, 0.3f },
{ 1800, 0.1f },
{ 2100, 0.4f },
Here you can modify the columns positions and the hole distance from ground. To add a new cloumn add the following line to the column_positions[][] array:
{ <X coordinate of column>, <Y coordinate of hole where 0.5f is center of screen>}
Modify Any Text/Translate
strings.xml Contains all the text in the App. Feel free to re-word anything or translate the language from here.Editing Images
Most of the images have with them included the .ai file. So feel free to edit them as you like especially the main Character. Remember to keep the same image resolution before replaceing it with the one in eclipseThis Screen Shoot :
Link Download :
1. Apk File
2. Source Code
No comments:
Post a Comment