i was wondering if anyone knew of any ways i could go about having “wallbangs” in my 2d shooter?
You felt the need to put quotation marks around that word, so you obviously know it’s not clear what you mean. And then you don’t even elaborate. I have no idea what you’re talking about.
Do you mean wallbangs from CS:GO? Like shooting through a wall?
exactly
This really depends on how your firing mechanics are setup. If you’re using raycasts for projectiles this is pretty simple, if you’re using physically simulated bodies it’s a bit a bit trickier. Both solutions would require you to raycast forward, find a collision with a wall, then determine the depth of the wall and apply specific logic to attenuate the damage / speed / other properties of your bullet.
Here’s a video that has some very good visualizations of how this works in games like CS:GO and Arma III:
I know those are 3D examples, but the implementation would be fairly similar in a 2D game. Unfortunately I can’t provide you with any links to specific tutorials since I don’t know of any off hand and I don’t know what your specific use case / implementation is.