Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

Give a map editor for cocos2d

Replies

  • JCrewJCrew Posts: 7New Users
    Tiled Map Editor is probably the best and frequently updated map editor out there for Cocos2D. Plus it's free! It can be found at: http://www.mapeditor.org/
    BrokenKings
  • BrokenKingsBrokenKings Posts: 3New Users
    I second the recommendation for Tiled. It's great, gives you a lot of flexibility in level formats (since you can add attributes as dictionaries to objects or tiles, giving you a lot of freedom in terms of what you can make it do at load time); and it supports tilemaps, which are great for building 2D levels fast without needing tons of new art all the time. Plus I am pretty sure the source code for Tiled is Open Source, so you can make changes to it if you need to.

    I've tried LevelHelper and it seems like it would be ok for a physics game, but it's pretty tied to SpriteHelper and doesn't quite have the flexibility Tiled did. But I didn't get very deep into it, either.

    CocosBuilder is making nice progress, at this point I am using it for user interfaces but the guy making it is adding lots of neat features and its one to look out for for potential future usage.
  • ShiroboiShiroboi Posts: 14Registered Users
    Third recommendation for tiled. Its also one of the few that can do an isometric view which is what i use for my game. Also, i've talked to the creators. They're really cool and helped me with a few problems that I had.
    Charred Dirt Defense, coming late 2012 to iOS.

    www.charreddirt.com



    Twitter: @CharredDirt https://twitter.com/CharredDi
  • tetrisleetetrislee Posts: 21New Users
    Hi,
    I'm doing a few things with TMX maps right now myself. Layers seem to be the key here. I'm generating the map in chunks, the plan is to dynamically load and unload the map pieces as needed. Here's my map generation code, it's pretty basic but might help if you choose to go the chunking route.

    #define kNumRows 3
    #define kNumCols 3

    // TileMap setup
    for (int y = 0; y < kNumRows; y++)
    {
    for (int x = 0; x < kNumCols; x++)
    {
    CCTMXTiledMap* top = nil;
    CCTMXTiledMap* left = nil;
    CCTMXTiledMap* bottom = nil;
    CCTMXTiledMap* right = nil;

    if (y > 0)
    bottom = mapSections[x][y-1];
    if (x > 0)
    left = mapSections[x-1][y];

    NSString* fileName = FileNameFromCoord(ccp(x,y));

    NSString* path = [[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:fileName];

    // create a map segment if it doesn't exist.
    // for now always create a segment.
    // if (![[NSFileManager defaultManager] fileExistsAtPath:path])
    {
    [OutdoorTMXGenerator newMapChunkWithName:path borderingChunkTop:top left:left bottom:bottom right:right];
    }

    CCTMXTiledMap* tileMap = [[CCTMXTiledMap alloc] initWithTMXFile:path];

    mapSections[x][y] = tileMap;
    int tMapWidth = [tileMap mapSize].width * [tileMap tileSize].width;
    int tMapHeight = [tileMap mapSize].height * [tileMap tileSize].height;
    [tileMap setPositionInPixels:ccp(tMapWidth * x, tMapHeight * y)];
    [self addChild:tileMap];
    }
    }

    Thanks
Sign In or Register to comment.