I am having trouble passing the objects from my tile map using the app Tiled
to my app on XCode. How should I loop / create a method to do that?
I have tried this but it seems that it doesn't work:
if let ice = group.objectsNamed("IceObject") as? [[String:AnyObject]]
{
for iceObj in ice {
let x = iceObj["x"] as? NSNumber
let y = iceObj["y"] as? NSNumber
iceSprite = SKSpriteNode(imageNamed: "ice.png")
iceSprite.position = CGPoint(x: CGFloat(x!), y: CGFloat(y!))
addChild(iceSprite)
}
}
group is initialized as a TMXObjectGroup