Created
July 19, 2011 15:31
-
-
Save mattapperson/1092789 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(NSArray*)moveTo:(id)args | |
{ | |
NSDictionary *props = [args count] > 0 ? [args objectAtIndex:0] : nil; | |
float posX = [TiUtils floatValue:@"posX" properties:props def:1.0f]; | |
float posY = [TiUtils floatValue:@"posY" properties:props def:1.0f]; | |
b2Vec2 moveToPosition = b2Vec2(posX, posY); | |
body->SetTransform(moveToPosition, body->GetAngle()); | |
//return B2VEC2_ARRAY(b2Vec2& velocity = body->GetPosition()); | |
//id action = [CCMoveTo actionWithDuration:0.4 position:CGPointMake( body->GetPosition().x * PTM_RATIO, body->GetPosition().y * PTM_RATIO)]; | |
//[sprite runAction:action]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment