Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

My first idea was to create a 2d array for my columns and rows, but it seems like there should be a better, or possibly cleaner, way to achieve this. Each square on the grid is going to have a background image, probably a .png although I might just draw the images with a draw method. Basically, I want to be able to drag and drop images onto the individual grid squares. I've been searching for a solution and the closest thing I can find is the tiled map solution. That just seems like a little overkill for what I'm trying to accomplish. Also, I don't know if this helps but i need my grid to be 12 by 12 and take up the entire width of the iphone screen.

share|improve this question
    
It's not really clear what you're looking for. Do you need a way to design a map and then import/display it on screen? Eg. drawing a level using a tool like Tiled. I'm confused about the "drag and drop images onto the individual grid squares" part. Do you want to have the drag'n'drop in your game (part of the gameplay) or is that just for the level-editing? –  bummzack Mar 31 '12 at 14:10
    
@bummzack Sorry about the lack of clarity. After a little more research, I think tiled is my best option. And as far as the drag and drop, I need that to be part of the game play. –  Scott Mar 31 '12 at 14:20
    
Tiled is certainly a possibility. But if you're creating a board-game (eg. you have just one 12x12 board) and don't require to load different levels or board-configurations, a simple 12x12 array is probably simpler to do than using Tiled. –  bummzack Mar 31 '12 at 14:28
add comment

1 Answer

up vote 2 down vote accepted

Use tiled map editor compatible with cocos2d.

A tutorial on this subject: http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d

share|improve this answer
    
Welcome to GDSE! I'm glad your answer was accepted. In the future, try to be more descriptive with your answers. Thanks for your answer. –  Byte56 Mar 31 '12 at 21:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.