| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- cc.Class({
- extends: cc.Component,
- properties: {
- // foo: {
- // // ATTRIBUTES:
- // default: null, // The default value will be used only when the component attaching
- // // to a node for the first time
- // type: cc.SpriteFrame, // optional, default is typeof default
- // serializable: true, // optional, default is true
- // },
- // bar: {
- // get () {
- // return this._bar;
- // },
- // set (value) {
- // this._bar = value;
- // }
- // },
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- start () {
- this.playScale();
- },
- playScale(){
- // console.log("play");
- this.node.stopAllActions();
- var s = cc.sequence(cc.scaleTo(0.5, 1.3),cc.scaleTo(0.5, 0.8));
- var repeat = cc.repeatForever(s);
- this.node.runAction(repeat);
- var s1 = cc.sequence(cc.rotateTo(0.1, -5),cc.rotateTo(0.1, 5));
- var r = cc.repeatForever(s1);
- this.node.runAction(r);
- }
- });
|