Three types of pickups: Ammo, Health and Stamina
Create a new scene called Pickup
With an Area2D as the root node
Assets -> Icons -> crystal_01i.png
Add a new RectangleShape2D for the Collision
Attach a new script to the Pickup node
mark the script as a tool script
so that we can view changes in the editor
Create a list of potential pickups
export them to the editor
You will now see a drop down
list of pickups in the inspector
Add a reference to the sprite node
so that we can dynamically change
Preload the textures so that we can
change them dynamically later
To update the icon in the editor
we can use the editor_hint function
within the process_function
This allows you to change icons in the editor
and see the change in real time
To update the icons during gameplay
Remember to connect the body entered signal
so that the player can pick the item up
and it is removed from the game world
to update the ammo, health and stamina info
You can now see these signals
Add variables for the pickup types
and their different amounts
Expand the node references
so that we can set up the GUI
Within the process function
In the physics process function
update the code for sprinting
to reflect changes in stamina
Assign keys such as 1 and 2
Now modify the input method
to handle the new actions
for drinking health potions
and drinking stamina potions
Add a new function to update
the interface to reflect how
many pickups the player has