dthrasher90 Posted April 17, 2017 Share Posted April 17, 2017 function qbPass() { var x = 1; // Math.floor((Math.random() * 3) + 1); console.log(x); switch (x) { case 1: var tweenFootballA = game.add.tween(football).to({ x: '+100', y: '-150' }, 3000); tweenFootballA.start(); tweenFootballA.onComplete.add(function newlocation (lineOfScrimmage){ var lineOfScrimmage = football.x; console.log("anon function = ", lineOfScrimmage); return lineOfScrimmage; }); lineOfScrimmage = football.y; console.log(lineOfScrimmage); // function los(lineOfScrimmage){ // lineOfScrimmage = football.y; // console.log("line of scrimmage = ", lineOfScrimmage); // } console.log('1'); break; Need some help here guys! Link to comment Share on other sites More sharing options...
squilibob Posted April 19, 2017 Share Posted April 19, 2017 x and y should be integers and not strings perhaps you meant x: football.x + 100, y: football.y - 100 Link to comment Share on other sites More sharing options...
Recommended Posts