0 votes

I need advice how best to implement HIT (power) meter(like in the PGA Tour) for my simple 3d game...thank you so much for aid.

enter image description here

in Engine by (454 points)

this is quiet easy to figure out:
first try thinking of all the steps involved in what you want to accomplish.
when should the action start? when should it launch? how hard should it push the ball?

By figuring out the limits of all these actions (how far it can move at most, and what's the least it can move) You can now start forming a flow chart of when to do what in your script.

1 Answer

+1 vote

Can be like this:

extends CanvasLayer

var health = 100

func _ready():

func _input(event):
    if event.is_action_pressed("damage"): # space key in input map
        health -= 10

func _fixed_process(delta):
    health += delta * 2

enter image description here

by (38 points)

Thanks very much for answers...
@alpasp Thanks,this is a health hit counter,but a need something else....explain: the player has shoot the ball when pressed the left button mouse but before he must press(UPBUTTON) to set speed of the ball, say that four levels of the speed -
1. 0 - 25% very slowly
2. 25 - 50% slowly
3. 50 - 85% fast
4. 85 - 100% quickly ....on the speed meter.
speed meter works of 0 - 100% and back to 0% when I release UP
...but I do not know how link (with script) the speed meter with shooting the ball
..when player release UP button and on the speed meter will be 38% which is slowly so that the ball flew slowly and not quickly.
Thanks to everyone for aid.

Edit: bullshit....NO!! UP_BUTTON....speed meter will (start) be automatically counting 0-100 and 100-0 when a player press the RMB which I have set as adding another(new) ball into the game and then player press LMB to launch ball...
that means player must wait to click on the basis of how quickly the balloon shoot.
enter image description here

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 Frequently asked questions and 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 [email protected] with your username.