Jump to content

Raycast for dynamic shadows


cub
 Share

Recommended Posts

Hi,

 

I'm started to port an Box2dWeb/CreateJS prototype game to Phaser (just to test and compare). With Box2dWeb I was able to do a dynamic shadow for a 2D game plateform with a raycast like this :

 

nom_raycast.png

 

Is it possible to do same compute with the actual physics system ? I see on github that on next major release "Integration with an advanced physics system. We've been experimenting with p2.js but have yet to conclude our research.". I found nothing about raycast with p2.js, but may be it is in your experimentation ?

Anyway congrats for phaser/pixi.js, always cool to see/test new tools :)

Link to comment
Share on other sites

For now I would use Box2dWeb with Phaser! It won't take much at all to integrate it, because the current in-built physics system surely won't give you the power you need (p2.js will, but not for a few months yet). If you do integrate Box2D you should disable the Sprite.body property (set it to null), then it won't do any Sprite physics at all and you're free to position it by just reading in Box2D values instead.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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