Slide 129
Slide 129 text
Målbevegelse
[self moveTowards:bee :&beeDestination :2*dt];
- (void) moveTowards: (CCSprite*)from: (CGPoint*)to: (float)amount
{
float dx = to->x - from.position.x;
float dy = to->y - from.position.y;
dx *= amount;
dy *= amount;
from.position = ccp(from.position.x + dx, from.position.y + dy);
}