0 votes

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!

Godot version Latest 3.2 standard version
in Engine by (12 points)

1 Answer

0 votes

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.

by (23 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.