1 decade ago by Skywalker
i have this function in an entity:
scale: function(scale){
if(this.anims.right.sheet.width == this.defaultAnimSize.x){
this.anims.right.sheet.image.resize(scale);
this.anims.right.sheet.image.width *=scale;
this.anims.right.sheet.image.height *=scale;
this.anims.right.sheet.width *= scale;
this.anims.right.sheet.height *= scale;
}
this.size.x *= scale;
this.size.y *= scale;
this.offset.x = this.offset.x * ( scale / 50 );
this.offset.y *= scale;/
}
this part "this.offset.x = this.offset.x * ( scale / 50 );" is throwing an error when I run my game: "Uncaught SyntaxError: Invalid regular expression: missing /"
maybe I'm just not seeing it but what it causing it to look for a regex instead of dividing?
scale: function(scale){
if(this.anims.right.sheet.width == this.defaultAnimSize.x){
this.anims.right.sheet.image.resize(scale);
this.anims.right.sheet.image.width *=scale;
this.anims.right.sheet.image.height *=scale;
this.anims.right.sheet.width *= scale;
this.anims.right.sheet.height *= scale;
}
this.size.x *= scale;
this.size.y *= scale;
this.offset.x = this.offset.x * ( scale / 50 );
this.offset.y *= scale;/
}
this part "this.offset.x = this.offset.x * ( scale / 50 );" is throwing an error when I run my game: "Uncaught SyntaxError: Invalid regular expression: missing /"
maybe I'm just not seeing it but what it causing it to look for a regex instead of dividing?