CollectHarvest.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. // foo: {
  5. // // ATTRIBUTES:
  6. // default: null, // The default value will be used only when the component attaching
  7. // // to a node for the first time
  8. // type: cc.SpriteFrame, // optional, default is typeof default
  9. // serializable: true, // optional, default is true
  10. // },
  11. // bar: {
  12. // get () {
  13. // return this._bar;
  14. // },
  15. // set (value) {
  16. // this._bar = value;
  17. // }
  18. // },
  19. },
  20. // LIFE-CYCLE CALLBACKS:
  21. // onLoad () {},
  22. start () {
  23. this.playScale();
  24. },
  25. playScale(){
  26. // console.log("play");
  27. this.node.stopAllActions();
  28. var s = cc.sequence(cc.scaleTo(0.5, 1.3),cc.scaleTo(0.5, 0.8));
  29. var repeat = cc.repeatForever(s);
  30. this.node.runAction(repeat);
  31. var s1 = cc.sequence(cc.rotateTo(0.1, -5),cc.rotateTo(0.1, 5));
  32. var r = cc.repeatForever(s1);
  33. this.node.runAction(r);
  34. }
  35. });