scoreCell.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. label: cc.Label,
  5. //particle: cc.ParticleSystem,
  6. },
  7. // LIFE-CYCLE CALLBACKS:
  8. // onLoad () {},
  9. init(s, num, pos) {
  10. this._score = s
  11. this.node.x = pos.x
  12. this.node.y = pos.y
  13. this.label.string = num
  14. //this.particle.resetSystem()
  15. this.node.scale = 1
  16. this.label.node.x = 0
  17. this.label.node.y = 0
  18. this.label.node.scale = 1
  19. let action1 = cc.scaleTo(0.1, 1.2, 1.2)
  20. let action2 = cc.moveBy(0.1, 0, 30)
  21. let action3 = cc.moveTo(0.2, 0, 0)
  22. let action4 = cc.scaleTo(0.2, 0.5, 0.5)
  23. // let seq = cc.sequence(action1, cc.callFunc(() => {
  24. // let seq2 = cc.sequence(action3, cc.moveBy(0.1, 0, 0), action4, cc.callFunc(() => {
  25. // s.scorePool.put(this.node)
  26. // }, this))
  27. // this.node.runAction(seq2)
  28. // }, this))
  29. // this.label.node.runAction(seq)
  30. let spa1 = cc.spawn(action1, action2)
  31. let spa2 = cc.spawn(action3, action4)
  32. let seq = cc.sequence(spa1, spa2, cc.callFunc(() => {
  33. s.scorePool.put(this.node)
  34. }, this))
  35. this.node.runAction(seq)
  36. }
  37. // update (dt) {},
  38. });