Disable respawn on leaving viewport

Recommended Posts

I have a portion of the game when the camera follows an entity (a taxi), not the main player, as it moves across the screen. The taxi is of type game.VehicleEntity which extends me.Entity.,;

As the entity moves left, the camera follows it, which is great. But it reaches a point when the screen fades out and respawns the entity in the center of screen and breaks the game.

1) If the viewport is following the entity, how is the engine determining that it is out of bounds?

2) How can I disable respawning if the entity "leaves" whatever bounds 

A video of the issue: 

@obiot @Parasyte

Share this post

Link to post
Share on other sites

@obiot @Parasyte I see, it's happening not because the Taxi is leaving the viewport, but because the mainPlayer entity standing there is left behind, which the viewport eventually leaves. So the question still stands: how can I disable the respawn/refresh if the player, or any entity, is out of bounds?

Share this post

Link to post
Share on other sites

2 more things :

* first your game is really looking awesome so far :)

* in the latest 6.0 version of melonJS we added a camera damping features that really help in smoothing camera movements

// set the camera to follow this renderable on both axis, and enable damping,, 0.1);


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.

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.


  • Recently Browsing   0 members

    No registered users viewing this page.