Skip to content

Instantly share code, notes, and snippets.

@mattapperson
Created July 19, 2011 15:31
Show Gist options
  • Save mattapperson/1092789 to your computer and use it in GitHub Desktop.
Save mattapperson/1092789 to your computer and use it in GitHub Desktop.
-(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