1

I am developing a html5/javascript game using the phaser package (http://phaser.io/)

As part of this I need to do some ray-casting to create a vision cone ahead and too the side of the character. In the past I have used unity where this is really strait forward but I cant understand how I would go about this using phaser.

I have sketched out what I would like to do:

character and wall

I really don't know where to start with this in javascript/phaser. The wall is made up of sprites currently. I cant find any good information on how to do ray-casting for obstacle detection anywhere so if someone could point me in the right direction that would be amazing.

Alternatively, could anyone suggest a better approach to obstacle detection in multiple directions?

1 Answer 1

1

Have you seen http://gamemechanicexplorer.com/#raycasting-1 ? Also try with https://github.com/codevinsky/phaser-light-and-magic

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.