cc.Class({
extends: cc.Component,
properties: {
jumpHeight: 0,
jumpDuration: 0,
maxMoveSpeed: 0,
accel: 0,
},
// LIFE-CYCLE CALLBACKS
onLoad : function () {
this.jumpAction = this.setJumpAction();
this.node.runAction(this.jumpAction);
},
setJumpAction: function () {
var jumpUp = cc.moveBy(this.jumpDuration, cc.p(0, this.jumpHeight)).easing(cc.easeCubicActionOut());
var jumpDown = cc.moveBy(this.jumpDuration, cc.P(0,-this.jumpHeight)).easing(cc.easeCubicActionIn());
return cc.repeatForever(cc.sequence(jumpUp, jumpDown));
}
// update (dt) {},
});