Posted January 29, 2024 by floz
gonna talk a bit about how the rocket launcher is implemented. if the nuts and bolts of how a game works bores you, that's fine... don't both reading this post.
now, the rocket launcher instantiates a rocket (obviously) when fired. that rocket has a collider that triggers the instantiation of an explosion scene. the explosion scene does the actual damage radius (area2d) and take_damage() call to the player. it can hurt you, you can absolutely accidentally yourself.
the method of using a circular area2d may not account for walls protecting you from the blast. if that turns out to be the case in testing, I will find a better method (possibly use the area2d and then ray-cast to check for impediment).
anyway, I'm getting ok at adding weapons, I want to try something different next. I may add powerups, health and ammo... we'll see.