BobDylan Posted September 11, 2014 Share Posted September 11, 2014 In my web-applications I use jQuery a lot, for example $.each() to iterate over arrays, etc.I would like to use these in a Phaser game as well.I could also use jQuery Mobile which is a bit lighter. Is this a good idea, or is this very likely to slow my game down?(Of course I understand I cannot use the DOM-selectors that jQuery is famous for). Link to comment Share on other sites More sharing options...
JUL Posted September 11, 2014 Share Posted September 11, 2014 Then you probably understand that you'll be using something half working.Expect half results, among other things. http://examples.phaser.io/ Check the example page to see if what you're planing to do with jQuery cannot already be done entirely with phaser.That's what I would do. Link to comment Share on other sites More sharing options...
lewster32 Posted September 11, 2014 Share Posted September 11, 2014 jQuery and Phaser play fine together, though some of the stuff like jQuery's each function is implemented already in most places it'd be useful, i.e. groups:group.forEach(function(sprite) { sprite.doSomething();});And in fact, if you're using Phaser, the browsers that it supports already have the native Array.forEach function available to them (which has exactly the same syntax as above, but works on all arrays) which is what jQuery's solution was partially created to do in case of older browsers not having it. jQuery's most useful feature in relation to Phaser is its ajax stuff - but most of its other functionality is pretty specific to DOM manipulation and cross-browser compatibility etc, which isn't directly useful in Phaser. JUL and Flowan 2 Link to comment Share on other sites More sharing options...
Recommended Posts