I'm working on a 2D game where the player will start with a pistol, and then will be able to walk over pickups to temporary upgrade to a better weapon, like a shotgun for example, for about a minute or so before reverting back to the pistol. My question is; would the coding structure/logic look something like this?:
Contains functions for handing basic physics, on_body_entered and exit
Base Gun scene:
-Position2D (to determine where bullets spawn from)
Base Gun script/class:
Function to instance and shoot bullet scene
Function that determines fire rate, bullet speed, cooldown between shots, etc. variables
Similar to Base Gun scene
Extend Base Gun class, but different variables like fire rate for the different pickup types
Create Node 2D scene called WeaponManager
Instance the Base Gun and Pickups as child nodes
Functions to determine current weapon in WeaponManager and call that pickup's firing pattern set in Pickup script
I know I'm missing a couple of functions, but just trying to determine the overall correct way before jumping in with two-feet. For some reason, I keep going between adding the fire rate, bullet speed, etc to the Bullet script vs the Base Gun script.
Appreciate any opinions on this!