dthrasher90

angular

3 posts in this topic

Is there a way to incorporate anugular with phaser?  can you share variables among the frameworks?

Share this post


Link to post
Share on other sites

I'd assume it would be fine, provided there's no naming conflicts.  

Depending what you want to do, you could probably just instantiate a phaser game object inside a controller or directive.  If you need this to persist beyond the scope of that controller/directive, maybe you could potentially put it in a service.  You could even put it in a RunBlock, and it would be fine.  I guess it all depends on what you're trying to do with Angular on top of Phaser.

Share this post


Link to post
Share on other sites

Yep, no reason they can't play nice together. Just make sure Angular doesn't try to destroy the Phaser DOM element (or recreate it) and you'll be golden.

I've partnered Pixi with React numerous times, whilst not the same libraries the essence is the same, and Angular should be easier as it'll work with a real DOM (unlike React which doesn't really like that sort of thing).

Aside from hiding in closure there is no way to stop a variable being shared around in JS so anything you want to share is fine. You'll have to be mindful that changes are updated and propagated correctly however, which can be painful.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.