Jump to content

Game not destroyed


mattferndale
 Share

Recommended Posts

I have a workaround for this but not sure it is optimal

When a specific collisions occurs I send off a request to the server and if they are no longer logged in I need to redirect them to login

if (response.status == 401)
			{
				console.log('not logged in');
				game.destroy();
				game = null;
				$interval.cancel(vm.intervalPromise);
				$window.location.href = '#/login';
			}else{

 

. The only way I have been able to get this to work is to change the state of the game

game.state.start('loginScene');

then add a button there to redirect to the login.

 

The error is it seems the phaser loop is still running if I call game.destroy from within the update of the active stage.

 

This is a mix of angular and phaser and except for this minor issue things have gone quite well

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...