Guest User

Untitled

a guest
Jun 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. function collectStar (player, star)
  2. {
  3. star.disableBody(true, true);
  4.  
  5. score += 10;
  6. scoreText.setText('Score: ' + score);
  7.  
  8. if (stars.countActive(true) === 0)
  9. {
  10. stars.children.iterate(function (child) {
  11.  
  12. child.enableBody(true, child.x, 0, true, true);
  13.  
  14. });
  15.  
  16. var x = (player.x < 400) ? Phaser.Math.Between(400, 800) : Phaser.Math.Between(0, 400);
  17.  
  18. var bomb = bombs.create(x, 16, 'bomb');
  19. bomb.setBounce(1);
  20. bomb.setCollideWorldBounds(true);
  21. bomb.setVelocity(Phaser.Math.Between(-200, 200), 20);
  22. bomb.allowGravity = false;
  23.  
  24. }
  25. }
Add Comment
Please, Sign In to add comment