Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Sabir_The_Trubbish |
extends KinematicBody2D
var charge = 0
func _ready():
pass
func _physics_process(delta):
chargeFunc()
func chargeFunc():
if Input.is_action_pressed(“attack”) and charge > 4:
charge = charge + 0.5
var chargeBar = get_parent()
if charge == 4:
chargeBar.texture = load("res://UI/FullCharge.png")
if charge == 3:
chargeBar.texture = load("res://UI/Charged3.png")
if charge == 2:
chargeBar.texture = load("res://UI/Charged2.png")
if charge == 1:
chargeBar.texture = load("res://UI/Charged1.png")
if charge == 0:
chargeBar.texture = load("res://UI/EmptyCharge.png")
if Input.is_action_just_released("attack"):
charge = 0