Make character use resorces to shoot

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nuxta

I am new in Godot and working on a 2d platformer game.
I have add feature to collect coins but i want to add feature
That make my character consume coins or food to fillup energy
and use it to attack once the bar is empty player can’t shoot any more
Until consume some more coins or food.

Please help me I am seriour with this project!

:bust_in_silhouette: Reply From: godot frajer

You could set it up so that every time you collect a coin, a variable in player’s script increases by 1. Then, when you shoot, check if the variable is greater than 0. If true, shoot and subtract the variable by one.