Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: None | Size: 0.39 KB | Hits: 54 | Expires: Never
Copy text to clipboard
  1. -(void)resetPlayerWithX:(float)x andY:(float)y
  2. {
  3.         invulnerable = YES;
  4.        
  5.         //set the position, reset velocity and angular rotation
  6.         playerBody->p = ccp(x,y);
  7.         playerBody->v = cpvzero;
  8.         playerBody->w = 0.0f;
  9.        
  10.         [self schedule:@selector(disableInvulnerability) interval:1.5f];
  11. }
  12.  
  13. -(void)disableInvulnerability
  14. {
  15.         invulnerable = NO;
  16.         [self unschedule:@selector(disableInvulnerability)];
  17. }