Ok so heres the error:
And here’s the code:
var Defbutton = pc.createScript('defbutton');
//Scenes
Defbutton.attributes.add("title", { type: 'entity', title: 'Title' });
Defbutton.attributes.add("level", { type: 'entity', title: 'Level' });
Defbutton.attributes.add("level2", { type: 'entity', title: 'Level Canvas' });
Defbutton.attributes.add("dlevel", { type: 'entity' });
Defbutton.attributes.add("result", { type: 'entity' });
//Buttons
Defbutton.attributes.add("rb", { type: 'entity', title: 'Retry Button' });
//ScoreSystem
Defbutton.attributes.add("one", { type: 'entity', title: '1' });
Defbutton.attributes.add("two", { type: 'entity', title: '2' });
Defbutton.attributes.add("three", { type: 'entity', title: '3' });
Defbutton.attributes.add("four", { type: 'entity', title: '4' });
Defbutton.attributes.add("five", { type: 'entity', title: '5' });
Defbutton.attributes.add("six", { type: 'entity', title: '6' });
Defbutton.attributes.add("seven", { type: 'entity', title: '7' });
Defbutton.attributes.add("eight", { type: 'entity', title: '8' });
Defbutton.attributes.add("nine", { type: 'entity', title: '9' });
Defbutton.attributes.add("ten", { type: 'entity', title: '10' });
Defbutton.attributes.add("eleven", { type: 'entity', title: '11' });
// initialize code called once per entity
Defbutton.prototype.initialize = function() {
this.entity.element.on('mouseenter', this.onEnter, this);
this.entity.element.on('mouseleave', this.onLeave, this);
this.rb.element.on('click', this.onClickrb, this);
};
// update code called every frame
Defbutton.prototype.update = function(dt) {
};
Defbutton.prototype.onEnter = function(event) {
document.body.style.cursor = 'pointer';
};
Defbutton.prototype.onLeave = function(event) {
document.body.style.cursor = 'default';
};
Defbutton.prototype.onClickrb = function(e) {
this.title.enabled = false;
this.level.enabled = true;
this.level2.enabled = true;
this.dlevel.enabled = true;
this.result.enabled = false;
this.resetnum();
};
Defbutton.prototype.resetnum = function() {
this.one.enabled = false;
this.two.enabled = false;
this.three.enabled = false;
this.four.enabled = false;
this.five.enabled = false;
this.six.enabled = false;
this.seven.enabled = false;
this.eight.enabled = false;
this.nine.enabled = false;
this.ten.enabled = false;
this.eleven.enabled = false;
};
// swap method called for script hot-reloading
// inherit your script state here
// Defbutton.prototype.swap = function(old) { };
// to learn more about script anatomy, please read:
// http://developer.playcanvas.com/en/user-manual/scripting/
So I keep getting that same error after the ball goes to its result screen
Any ideas why?