HomeForumsGeneral Discussionwarp object?

This topic has 2 voices, contains 2 replies, and was last updated by  Nat Weiss 97 days ago.

Viewing 3 posts - 1 through 3 (of 3 total)
Author Posts
Author Posts
February 8, 2012 at 9:22 am #2268

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?

February 9, 2012 at 8:16 am #2270

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);
}
}

February 11, 2012 at 7:56 pm #2272

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.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.