markp Posted March 30, 2014 Share Posted March 30, 2014 I've been having a problem with timer events and tweens not working at all and it would appear that just by having a script src to date.js included it causes the issue but I have no idea why. The data.js can be downloaded from this site https://github.com/datejs/Datejs. I'm using Phaser v2.0.1 and the latest datejs. I can reproduce the issue just by adding the following line to view_full.html in the examples and then trying one of the time based examples or one with animation. None of the animations or tweening will work.<script src="_site/js/date.js" type="text/javascript"></script>Obviously the data.js file must be dropped into the relative folder used in the src attribute. Swapping with moment.js is possibly as referencing that file does not affect the examples as far as I can tell. I'd rather understand why just including date.js causes phaser to completely stop handling time events and only if there isn't a solution convert to moment.js. Any ideas? Link to comment Share on other sites More sharing options...
Lotti Posted March 30, 2014 Share Posted March 30, 2014 no use of namespace in phaser and/or in date.js? Link to comment Share on other sites More sharing options...
powerfear Posted March 30, 2014 Share Posted March 30, 2014 I took a quick look at datejs and it is directly modifying the core Date object and its prototype. I'm suspecting it might be replacing an existing function on the Date object. The library hasn't been updated in 5 years so it's likely there has been api change to the Date object that cause compatibility issue with it. Link to comment Share on other sites More sharing options...
markp Posted March 30, 2014 Author Share Posted March 30, 2014 Thanks for taking a look. Think I'll use moment.js from now on. Link to comment Share on other sites More sharing options...
Recommended Posts