I want my boss to have an attack where when the projectile hits a wall it splits and goes in different directions, idk how to though
Sorry my game doesn’t have a tilemap so this doesn’t work
Make the walls a different, separate sprite. Then, you could add some collision code which would first check the projectiles direction. If it falls into the category of 8 directional, just add some code to check which of the 2 directions of more than the other and then only render that. On contact with the wall, use vx and vy code to help the projectile split up and bounce off the walls.
Tell me if this helps!
CrunchyToast
I think if you replace the “on overlap” block with a “on sprite hits wall at location” block. I’m pretty sure that will detect the wall bounces correctly, even though you don’t have a tilemap.
I tried this but it didn’t work, I think that only works on tilemaps
Yeah, I just tried it and it didn’t work. Looking at the code, it doesn’t look like there are many sprite events that you could use to detect this, besides maybe using an “On Destroyed Sprite of kind…” block, because projectiles get automatically destroyed when they go off screen?
You could always code in a loop that checks through all the projectiles to see if they are on the wall using their left, right, top, and bottom coords to detect.
You would want to check if the left or top of the sprite is less than or equal to 0 “( (mysprite) [left]) [<=] ( 0 ) )” and you would want to be checking if the right is >= 160 or bottom >= 120.