more ui tweaks and started on enemy health bar

This commit is contained in:
derek
2025-03-19 17:00:08 -05:00
parent 573a20cfa8
commit b85014c48b
13 changed files with 87 additions and 1 deletions

7
scripts/3D Health Bar.gd Normal file
View 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)

View File

@@ -0,0 +1 @@
uid://dfc80ru6aro15

View File

@@ -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

View File

@@ -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