casings integrate player velocity, can't pick up already held guns
This commit is contained in:
@@ -19,7 +19,6 @@ const DEAD_CAM_FOV = 50.0
|
||||
|
||||
var focus_dist
|
||||
var target : Node
|
||||
var focus_target
|
||||
var respawn_position
|
||||
var respawn_rotation
|
||||
var taunt_node
|
||||
@@ -64,12 +63,6 @@ func _ready():
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
if target != null:
|
||||
focus_dist = camera.global_position.distance_to(target.global_position)
|
||||
else:
|
||||
focus_dist = 10.0
|
||||
camera.attributes.dof_blur_far_distance = focus_dist + 8
|
||||
camera.attributes.dof_blur_near_distance = focus_dist - 2
|
||||
|
||||
if target == null:
|
||||
anim_step = 3
|
||||
@@ -79,6 +72,7 @@ func _process(delta):
|
||||
match anim_step:
|
||||
0:
|
||||
#Show enemy that killed player
|
||||
focus_on_target(target)
|
||||
var target_pos_adjusted = Vector3(target.position.x -4,target.position.y + 4,target.position.z -4)
|
||||
cam_target.global_position = lerp(cam_target.global_position,target_pos_adjusted,delta * MOVE_SPEED)
|
||||
look_ray.global_position = target_pos_adjusted
|
||||
@@ -87,6 +81,7 @@ func _process(delta):
|
||||
camera.fov = lerp(camera.fov, 40.0, delta * 5)
|
||||
1:
|
||||
#aim at player from enemy
|
||||
focus_on_target(level_control.player)
|
||||
Engine.time_scale = .05
|
||||
AudioServer.set_bus_effect_enabled(0,0,true)
|
||||
taunt_node.visible = false
|
||||
@@ -110,3 +105,11 @@ func _on_timer_timeout():
|
||||
|
||||
func reload_level():
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
func focus_on_target(focus_target):
|
||||
if target != null:
|
||||
focus_dist = camera.global_position.distance_to(focus_target.global_position)
|
||||
else:
|
||||
focus_dist = 10.0
|
||||
camera.attributes.dof_blur_far_distance = focus_dist + 8
|
||||
camera.attributes.dof_blur_near_distance = focus_dist - 2
|
||||
|
||||
Reference in New Issue
Block a user