bloodbarron115 Posted March 31, 2015 Share Posted March 31, 2015 I need these 2 variables: newEquation: function () { var x = Math.floor(Math.random() * (10 - 1)) + 1; var y = Math.floor(Math.random() * (10 - 1)) + 1;} to be defined in this if statement: update: function () { if (myInput == x + y) { this.correct(); } else { this.wrong() }}, While staying in the newEquation funciton Link to comment Share on other sites More sharing options...
mrdotb Posted March 31, 2015 Share Posted March 31, 2015 var x; var y; newEquation:function(){ x = Math..... y = Math... } update:function(){ if(myInpunt == x+y) ... else ... } Link to comment Share on other sites More sharing options...
Recommended Posts