Skip to content Skip to sidebar Skip to footer

New State With Phaser

I'm trying to switch state with a collision. So when the player hits another sprite it should switch state, but it doesn't.. First I'm declaring the player and the enterDoor sprite

Solution 1:

So with the code above I wasn't able to get the overlap to trigger at all. After disabling moves on the player sprite's body the overlap was triggered.

player.body.moves = false;

Your enterHouse function doesn't need to accept the two sprites, and can be left as-is.

What I don't know is why this is necessary.

Post a Comment for "New State With Phaser"