Showing posts with label Texture Packer. Show all posts
Showing posts with label Texture Packer. Show all posts

Thursday, September 1, 2011

Working with Texture Packer

In my post about some simple iOS and Android programming tips I mentioned a software called Texture Packer that is very useful in creating Sprite Sheets.  Below are the steps that can be used to create a simple Sprite Sheet which are the steps that I used in creating Word Crank.

Instructions



  1. Open Texture Packer.  You will be presented with a blank view where you can add your Sprites.

  2. Click on the 'Add Sprites' button to select the Sprites that you want to include in your Sprite Sheet.

  3. Once you have selected your Sprites, just click the 'Publish' button and you can will have two files, the .png file which is your Sprite Sheet and a .plist file which can be used to identify where each object is located in the Sprite Sheet.


Screen Shots




 

 

 

 

 

 

 

 



 

 

 

 

 

 

 

 

 

 

Monday, August 29, 2011

Tips: Programming for Android and iOS

As I continue my foray into game development on the iOS and Android platforms I wanted to take a few moments to share some tips that I have found to be very useful in creating an application that can will eventually run on both platforms.

Tips


General



  1. Separate the game logic from the user interface layer.  This will make it easier to port the code over to the accompanying platform.  For example, if you put the main game loop logic in a separate Java class, then you basically can just do a line by line conversion to Objective-C when you port it to iOS.

  2. Place all Strings in one location.  Have a Constants.java where you put all of your static String objects, then when you port to iOS you just use the same thing, except now it is Constants.h.

  3. If you are going to use Texture Atlases in your game, create them using a tool such as Texture Packer and then you will have the exact location of each Sprite stored in a file that can be easily referenced for both versions of the game.


iOS


Use a framework! Working with Cocos2d made the transition relatively smooth as we converted Word Crank from its Android version to iOS.

Android


Get a good book, I read Beginning Android Games, it helped lay a good foundation for working with Android and understanding the various states of a running application and the GLSurfaceView that serves as the main background for all OpenGL drawings.

Any questions? Just leave a comment. Thanks.