started work on camera going red with damage
This commit is contained in:
@@ -76,6 +76,7 @@ var pickupmsg
|
||||
@onready var pickup_sound = $Audio/PickupSound
|
||||
@onready var ear_wind = $Audio/EarWind
|
||||
@onready var hurt_audio = $Audio/Hurt
|
||||
@onready var health_indicator = $HealthIndicator
|
||||
|
||||
@onready var weapon_spawner = $Head/Camera3D/WeaponHolder/WeaponSpawner
|
||||
@onready var pick_up_detection = $pick_up_detection
|
||||
@@ -85,6 +86,10 @@ func _ready():
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
start_sensitivity = SENSITIVITY
|
||||
|
||||
var viewportWidth = get_viewport().size.x
|
||||
var viewportHeight = get_viewport().size.y
|
||||
health_indicator.size = Vector2(viewportWidth,viewportHeight)
|
||||
health_indicator.color = Color(0.471, 0, 0, 0)
|
||||
|
||||
#turn off audio if unchecked in player
|
||||
if AUDIO == false:
|
||||
@@ -152,6 +157,10 @@ func _physics_process(delta):
|
||||
var target_fov = BASE_FOV + FOV_CHANGE * velocity_clamped
|
||||
camera.fov = lerp(camera.fov, target_fov, delta * 8)
|
||||
|
||||
# Health Indicator
|
||||
var health_opacity = 1 - level_control.health / level_control.start_health
|
||||
health_indicator.color = lerp(Color(0.471, 0, 0, 0), Color(0.471, 0, 0, .25),health_opacity)
|
||||
|
||||
# Land sound
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user