Jump to content

Prevent a controllable sprite to leave the canvas / background.


kenshm
 Share

Recommended Posts

Hi,

(I apologize in advance for my bad English. I'm from Switzerland.)

 

I recently bought this plugin : http://www.phaser.io/news/2015/04/virtual-joystick-plugin-released :)

The goal is to control a ship in space with the joystick above.

Everything works fine but the problem is that my ship could get out of the world. I'd like to know how to block it and prevent it from leaving the background / canvas.
I used the arcade physics.
 
Despite the examples available here, I did not succeed.
Can you help me, please ?

PS :
Is it possible to use several collisions system in the same phaser game (example : arcade + p2) ?

Best regards,
Kenshimdev

 

 

 


 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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