#weapons combat system

5 messages · Page 1 of 1 (latest)

tidal oak
#

I'm thinking about creating a combat system similar to hotline miami. I want enemies to be able to hold weapons and if I stun them, the weapon drops. I can pick up the gun, shoot and throw. If I throw it, the gun will stay on the ground with the same amount of bullets as when I dropped it. My plan to do this was to create an area2d for the weapon along with a sprite and a collisionshape that delimits the area in which the player must be to pick up the weapon. If the player is inside this area and presses the right mouse button, then I quee_free() in the 2d area and change the character's sprite according to the weapon he picked up, in addition, I run the weapon function to to make it have its characteristics (such as shooting speed, amount of ammunition, etc...) you would have to make these settings for each weapon in the game. If I am holding the weapon and click with the right mouse button, then my character's sprite returns to the "default", that is, without weapons and a 2d area will be instantiated again with a speed in the direction in which I throw the weapon. weapon.

#

my area2d code