Getting a Professional Look

Games are meant to be played as immersively as possible. To make this possible on a tablet or any device, you have to remove all the bars and menus that remind the player of the world outside their game. Android has some features that make this effective, but Android 3.0 includes features that actually mandate having the system bar always visible. Regardless, you can hide the action bar with a simple line in the MainActivity.java file. Listing 2-11 shows the statement that should go right after the super command.

Listing 2-11. Removing the Action Bar

getActionBar().hide();

If you run the project now, the top bar that has the Android robot icon in it is gone. The image should move across the screen as normal. To make your game look more professional, you can change the default icon into something more suitable for your game. When a player wants to open your game, they go to their homepage and select the app. Providing a vibrant icon that grabs their attention is important.

Before creating your own icon, jot down the icon sizes. You need to have 72 × 72, 48 × 48, and 32 × 32 versions. In your graphics editor, create an icon with the largest dimensions, and then scale it down for the others. When you have the three files, name them icon.png and replace the other icon files in each of the resolution categories under the res folder.

For now, the only other work to be done is to put a header on your code, like the one shown in Listing 2-12, so you can distribute your game without worrying about people taking your work without giving you credit. Granted, anything posted online is liable to be used inappropriately, but putting your signature on your work can help people ask you questions or at least give credit where credit is due.

Listing 2-12. A Sample Comment Header Above Your Code

/********************************************************************          
    * GraphicsTest – illustration of basic sprite principles        *  
    *                                                               *  
    * Author:  Kerfs, Jeremy                                        *  
    *                                                               *  
    * Last Modified: Jan 1st, 2000                                  *  
    *                                                               *    
    * Version: 1.0                                                  *  
    *                                                               *  
    ******************************************************************/

If you’re really interested in protecting your work, you can release the code under a license. For example, the Android code itself is released under the Apache License Version 2.0, which is very liberal in allowing users to use the code largely for whatever projects they can dream up. If you release your code online, be ready to offer it under a license that keeps it open source and lets others develop on it.

images Tip For more information about the Creative Commons license and how open source projects work, go to http://creativecommons.org/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.19.17