pretty happy with hud minimap
This commit is contained in:
@@ -18,11 +18,17 @@ func Enter():
|
||||
clear_points_of_interest()
|
||||
|
||||
func Physics_Update(delta):
|
||||
update_minimap(0,2.0,ColorSwatch.RED_COLOR)
|
||||
if enemy.is_player_visible():
|
||||
#reset lost target timer
|
||||
lost_target_timer = time_to_lose_target
|
||||
#attack move and look
|
||||
attack_move_and_look(delta)
|
||||
#get player location
|
||||
enemy.cache_player_pos()
|
||||
#set player location as target
|
||||
update_player_target()
|
||||
#move and look at location
|
||||
move_to_nav_point(delta)
|
||||
turret_look3D(delta)
|
||||
#Initial wait time
|
||||
if initial_timer > 0:
|
||||
initial_timer -= delta
|
||||
@@ -37,19 +43,12 @@ func Physics_Update(delta):
|
||||
else:
|
||||
if lost_target_timer > 0:
|
||||
lost_target_timer -= delta
|
||||
attack_move_and_look(delta)
|
||||
#move and look at location
|
||||
move_to_nav_point(delta)
|
||||
turret_look3D(delta)
|
||||
else:
|
||||
Transitioned.emit(self,"search")
|
||||
|
||||
func attack_move_and_look(delta):
|
||||
#get player location
|
||||
enemy.cache_player_pos()
|
||||
#set player location as target
|
||||
update_player_target()
|
||||
#move and look at location
|
||||
move_to_nav_point(delta)
|
||||
turret_look3D(delta)
|
||||
|
||||
func attack_sequence(delta):
|
||||
if shot_timer > 0:
|
||||
shot_timer -= delta
|
||||
@@ -94,6 +93,3 @@ func spawn_casing():
|
||||
instance_casing.transform.basis = enemy.casing_ejector.global_transform.basis
|
||||
instance_casing.player_velocity = enemy.velocity * enemy.transform.basis
|
||||
get_tree().get_root().add_child(instance_casing)
|
||||
|
||||
func update_minimap():
|
||||
SignalBus.emit_signal("ui_minimap_point",self,enemy.global_position,ColorSwatch.RED_COLOR)
|
||||
|
||||
Reference in New Issue
Block a user