jerry

How to disable updating when a sprite is out of camera view?

Recommended Posts

I believe phaser updates every sprite added to the game( I tried to set alive=false/autoCull=true/visible=false, none of them prevent updating.)

But it seems in many games, enemies only move and shoot when they r in the camera view or reach to a certain distance to the hero. I think this is more effective.

Any one know how to disable updating when a sprite is out of camera view, and enable it when it's in camera view. Thanks.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.