more ui tweaks and started on enemy health bar
This commit is contained in:
7
scripts/3D Health Bar.gd
Normal file
7
scripts/3D Health Bar.gd
Normal file
@@ -0,0 +1,7 @@
|
||||
extends Control
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
queue_redraw()
|
||||
|
||||
func _draw() -> void:
|
||||
draw_circle(Vector2.ZERO,0,Color(1,1,1,1),true,10,true)
|
||||
1
scripts/3D Health Bar.gd.uid
Normal file
1
scripts/3D Health Bar.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dfc80ru6aro15
|
||||
@@ -27,6 +27,7 @@ var crosshair_target
|
||||
@onready var pickup_item_indicator = preload("res://assets/pickup_item_indicator.tscn")
|
||||
@onready var wobble_items: Control = $WobbleItems
|
||||
|
||||
|
||||
const STAM_BAR_MAX_OPACITY = 1.0
|
||||
const CROSSHAIR_SIZE = Vector2(40,40)
|
||||
|
||||
@@ -58,6 +59,7 @@ func _ready() -> void:
|
||||
func _process(delta: float) -> void:
|
||||
player = level_control.player
|
||||
|
||||
|
||||
if player != null:
|
||||
|
||||
#HEALTH
|
||||
@@ -82,6 +84,7 @@ func _process(delta: float) -> void:
|
||||
|
||||
money.text = "$" + str(money_count)
|
||||
|
||||
|
||||
if player.gun != null and player.gun.weapon_info.weapon_type == 0:
|
||||
if GameGlobals.gun_ammo.has(player.gun.weapon_info.gun_name) and GameGlobals.gun_ammo[player.gun.weapon_info.gun_name] != null:
|
||||
ammo_counter.visible = true
|
||||
|
||||
@@ -280,6 +280,8 @@ func bullet_fire():
|
||||
func can_fire():
|
||||
if anim_player.is_playing() and anim_player.current_animation == "reload":
|
||||
return false
|
||||
elif weapon_info.weapon_type == 0 and GameGlobals.gun_ammo[weapon_info.gun_name] <= 0:
|
||||
return false
|
||||
else:
|
||||
return true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user