I'm wondering if anyone has suggestions for how to manage the positioning of many sprites in pre-set and complicated patterns? Currently the brute-force method is to painstakingly code each sprite into its place. However, ideally, I would like to not have to code it directly, but instead read the sprite positions in from a file (or some other data source). Are there any solutions out there that do this?

  • \$\begingroup\$ This question may be relevant. \$\endgroup\$
    – Anko
    Aug 8, 2014 at 20:46
  • \$\begingroup\$ ya, I guess the answer is no, then. I was looking for something like the wonderful Tiled or Particle Designer. Probably an opportunity in the market place to build a tool that does this. Wouldn't be hard. \$\endgroup\$
    – gdbj
    Aug 8, 2014 at 20:54
  • \$\begingroup\$ @GregoryJohnson Questions about which technology to use are considered off-topic here. That being said: maybe you should check out SpriteBuilder (formerly CocosBuilder). \$\endgroup\$
    – bummzack
    Aug 10, 2014 at 7:02

1 Answer 1


You're on iOS using Objective-C, I assume, so use PLIST files.

XCode has an excellent PLIST editor. NSDictionary lets you load a PLIST file with a single method call:

NSDictionary * plistDict = [NSDictionary dictionaryWithContentsOfFile:@"test.plist"];

From that, it is very easy to automate. Just load the dictionary and set the sprite position:

double x = [[plistDict objectForKey:@"sprite_pos_x"] doubleValue];
double y = [[plistDict objectForKey:@"sprite_pos_y"] doubleValue];

sprite.position = ccp(x,y);

If you change the sprite position in the PLIST, there is no need to recompile. With a bit of work, you can even add runtime reloading of modified files.

  • 1
    \$\begingroup\$ yes, this is the method I would go with... or actually, JSON would be better, since I would want to have the type of sprite loaded dynamically as well. As I said above, it's probably really easy to put a GUI around this idea. Countless side-scrolling games have this concept. I was looking for a GUI based tool to help put the patterns together... point and click. Apparently someone out there thinks this is a dumb question tho. haha... dunno, seems like a good idea to me! \$\endgroup\$
    – gdbj
    Aug 10, 2014 at 3:17

Not the answer you're looking for? Browse other questions tagged .