cocos creator调试时候有问题,但是构建发布就ok
发布于 6 年前 作者 dwang 8557 次浏览 来自 问答
cc.Class({
    extends: cc.Component,
 
    properties: {
 
    },
     
    setMoveUpAction: function(height) {
        var moveHeight = height;
        var moveUp = cc.moveBy(this.jumpTimes, cc.p(0, -height));
        return moveUp;
    },
    //initialize
    onLoad: function() {
     
    }
});
var MoveBg = require("BgMove");
onTouchEnded: function(touch, event) {
                if(self.player.getPositionY() > 0) {
                    var height = self.player.getPositionY();
                    self.player.setPositionY(height/2);
                     
                    bg1.node.runAction(bg1.setMoveUpAction(height));
                    bg2.node.runAction(bg2.setMoveUpAction(height));
                }
            }  

就是在设置背景滚动的时候,runAction这个地方一直在报错,而且在cocos模拟器中运行时背景并不滚动,每次运行到那时候就报下面这两个错,但是构建发布到小程序开发里面,背景也可以动了,报错也没有了。。。小白刚入门,请求大神指点一下~~~ cocos creator版本是1.10.0

回到顶部