Hi all,
I’m working on a game that heavily relies on the Phaser-raycaster plugin to perform “bullet” vs tile “destruction.”
The way this works is during a “shooting loop” I’ll cast a ray from roughly the tip of my character’s gun to the nearest tile intersection. The colliding tiles index will be checked, and moved along to it’s next stage of destruction (just another tile, but more broken), see screenshot of tileset below to get a feel for what I mean.
The thing is, since introducing the new tiles (the purple brick ones), the raycasting plugin is ignoring the later stages of each tile’s destruction, enabling the player to just shoot straight through them with no effect. To see this in action check out this clip:
As the game is open source, here are a couple links to relevant lines of code:
- Where the player’s
bulletRaycaster
is setup: farzone/Mech1.js at new-tileset-wip · saricden/farzone · GitHub - Where the player’s ray is cast: farzone/Mech1.js at new-tileset-wip · saricden/farzone · GitHub
- Where tile “damage” is handled: farzone/GameScene2.js at new-tileset-wip · saricden/farzone · GitHub
If anyone has experience with the plugin and has any thoughts as to what’s going on please do let me know, I’m really struggling with this one!