You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

31 lines
447 B

  1. module.exports = {
  2. type: 'resourceNode',
  3. collisionEnter: function (obj) {
  4. if (!obj.player)
  5. return;
  6. obj.gatherer.enter(this.obj);
  7. },
  8. collisionExit: function (obj) {
  9. if (!obj.player)
  10. return;
  11. obj.gatherer.exit(this.obj);
  12. },
  13. gather: function () {
  14. this.quantity--;
  15. if (this.quantity <= 0)
  16. this.obj.destroyed = true;
  17. },
  18. simplify: function () {
  19. return {
  20. type: 'resourceNode',
  21. nodeType: this.nodeType
  22. };
  23. }
  24. };