Game Development Reference
In-Depth Information
bodyWithRectangleOfSize:CGSizeMake(30, 30)];
newplayer.physicsBody.friction = 1.0f;
newplayer.physicsBody.linearDamping = 1.0f;
}
The final init function should look something similar to the following screenshot:
We have created a newPlayer object and have also associated the physics body
with it.
7. Now we have our player ready to seek the target. Wherever we tap on the screen,
the player will seek to that location. In the touchesBegain:withEvent
method, add the following line of code:
Search WWH ::




Custom Search