Hi,
What's the best way of comparing two object positions? I have characters and allowed starting positions which I load in an editor like this:
I want the user to be unable to start the simulation if the placed character position is not within an allowed character position, and am therefore wondering if there is any way of comparing the two?
Thanks!
What's the best way of comparing two object positions? I have characters and allowed starting positions which I load in an editor like this:
Code: Select all
//Load Characters
for (CharacterPosition *characterPosition in self.dataLevel.placedCharacterPositions) {
ToolBarCharacter *character = [[ToolBarCharacter alloc] initWithData:characterPosition];
[self addChild:character];
[spritesOnScreen addObject:character];
[dictionary setObject:character forKey:[NSString stringWithFormat:@"%@", characterPosition]];
}
//Load allowed character positions
for (CharacterPosition *allowedPosition in [self.dataLevel allowedCharacterPositions]) {
ToolBarStartPos *pos = [[ToolBarStartPos alloc] initWithData:allowedPosition];
[self addChild:pos];
[spritesOnScreen addObject:pos];
[dictionary setObject:pos forKey:[NSString stringWithFormat:@"%@", pos]];
}I want the user to be unable to start the simulation if the placed character position is not within an allowed character position, and am therefore wondering if there is any way of comparing the two?
Thanks!