SHARE
TWEET

Untitled

a guest May 31st, 2014 270 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Create:
  2.         playergroup = this.add.group();
  3.         playergroup.enableBody = true;
  4.         playergroup.physicsBodyType = Phaser.Physics.ARCADE;
  5.         playergroup.setAll('checkWorldBounds', true);
  6.         playergroup.setAll('outOfBoundsKill', true);
  7.         playergroup.setAll('anchor.x', 0.5);
  8.         playergroup.setAll('anchor.y', 0.5);
  9.        
  10.         /*...*/
  11.  
  12.         player = this.add.sprite(this.world.centerX, this.world.centerY, 'green');
  13.         player.anchor.set(0.5);
  14.  
  15.         /*...*/
  16.  
  17.         orbiter = this.add.sprite(0, 0, 'red', 0, playergroup);
  18.         orbiter.pivot.x = -40;
  19.         orbiter.pivot.y = 0;
  20.  
  21.         playergroup.x = player.body.x;
  22.         playergroup.y = player.body.y;
  23.        
  24. Update:
  25.         orbiter.angle += 1;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top