Terumi Posted November 7, 2013 Share Posted November 7, 2013 Hello, How can you implement a pacman like behaviour without using worldbounds?Say that I have a 5x5 grid in the middle of the stage. Whenever a sprite exits the grid I want it to 'wrap around '. I could do something liketween a sprite till the end of the gridteleport it just outside the other side of the gridtween it to its destinationBut this would seem like a glitch in the teleportation part. It would be nicer to have the grid simulate the game bounds and if a sprite exits the stage , the teleportation to the other side would be transparent. This effect could be achieved using a mask, but I don't know if such a thing can implemented using phaser. Sorry If I sound weird, it was just random thoughts...Does anyone has any ideas on how to implement such a behaviour? Thank you Link to comment Share on other sites More sharing options...
Mike Posted November 7, 2013 Share Posted November 7, 2013 Hm... if I understand the problem is that if you "teleport" the sprite than for brief second it will disappear or it will disapear early because it hit the right side.... I'm not realy into tween animation... but beside that there is example where sprite goes out from one side and then comes form the the other: http://gametest.mobi/phaser/examples/_site/view_full.html?d=animation&f=looped+animation.js&t=looped%20animation Link to comment Share on other sites More sharing options...
Terumi Posted November 7, 2013 Author Share Posted November 7, 2013 This example uses world bounds, we can see the sprite exiting the "world" and the "teleportation" happens when the player is completely out of the scene.If the "world" was not taking the full width of the screen, how could we create the same hiding effect to the sprite? Link to comment Share on other sites More sharing options...
Terumi Posted November 9, 2013 Author Share Posted November 9, 2013 This can be achieved using masks.As it appears phaserjs supports them Link to comment Share on other sites More sharing options...
Recommended Posts