 realfolkblues | Hi! I am reading the book and it’s great stuff. I’m trying to make a top down rpg game like zelda. i’m stuck on the warp to different level. i made the object in the tmx file but i can’t find/figure out the code to read in all the objects find the warp objects and then read the property for the object to know what level to load. anyone know where to find this code in the book/included code? |
 realfolkblues | OK so i figured out how to find the objects that are named warp and pull out the data about them. but now i don’t know how to test for collision with them. any help? NSMutableDictionary * warp = [tileMapObjects objectNamed:@"warp"]; for (warp in [tileMapObjects objects]) { if ([[warp valueForKey:@"name"] isEqualToString:@"warp"]){ NSString * toLevel = [warp valueForKey:@"to"]; NSLog(@"the to level is %@",toLevel); } } |
 Nat Weiss | Why not just use the Warp class? It already checks for collision in its update method. Check out level1.tmx and step on a warp to try it out. |