Closed NI92 closed 9 years ago
@NI92 I assume you have realized this, but the physicsBody property is a built-in thing, not something that I have written. You don't have to use uint64_t as a type for your bitmask, you can still use uint32_t and it will be compatible. Thought I'd leave that here for anyone in the future who sees this.
Hello. First off, thank you for JSTileMap. Now to the request: could you please update JSTileMap to work in 64 bit? It kind of does now (tmx maps load) but adding physicsBody's to tiles that have categoryBitMasks such as static const uint64_t bushCategory = 0x1 << 0; doesn't work. I'm learning how to do all of this thanks to a book called 'iOS Games by Tutorials' (Objective-C version) and they use the following technique to attach a physics body to a tile that has a property "bush" set in a tile in Tiled:
(void)createNodesFromLayer:(TMXLayer )layer {
JSTileMap map = layer.map; //1 for (int w = 0 ; w < self.gridSize.width; ++w) { for(int h = 0; h < self.gridSize.height; ++h) { CGPoint coord = CGPointMake(w, h); NSInteger tileGid = [layer.layerInfo tileGidAtCoord:coord]; if(!tileGid) continue; if([map propertiesForGid:tileGid][@"wall"]) { SKSpriteNode *tile = [layer tileAtCoord:coord];
} } } }
The map created in Tiled loads but accessing properties doesn't seem to work for me. Thank you & have a good day.