Show network Ping & start AI behaviour tree
This commit is contained in:
@@ -2,9 +2,20 @@ extends Node
|
||||
class_name Hitable
|
||||
|
||||
var health = 200
|
||||
var enemies_in_range = []
|
||||
|
||||
func Hit(dmg):
|
||||
#var tween = create_tween()
|
||||
health -= dmg
|
||||
if(health <= 0):
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_area_3d_body_entered(body):
|
||||
if body.get_collision_layer() == 10:
|
||||
enemies_in_range.append(body)
|
||||
|
||||
|
||||
func _on_area_3d_body_exited(body):
|
||||
if body.get_collision_layer() == 10:
|
||||
enemies_in_range.erase(body)
|
||||
|
||||
@@ -47,7 +47,11 @@ func _process(_delta):
|
||||
label.text = "H Velocity: %3.2f" % [Vector2(velocity.x, velocity.z).length()]
|
||||
label.text += "\nV Velocity: %3.2f" % [velocity.y]
|
||||
label.text += "\nOn floor: %s" % is_on_floor()
|
||||
label.text += "\nNetwork ID: %d" % multiplayer.get_unique_id()
|
||||
if(multiplayer.get_unique_id() == 1):
|
||||
label.text += "\nNetwork ID: HOST"
|
||||
else:
|
||||
label.text += "\nNetwork ID: %d " % multiplayer.get_unique_id()
|
||||
label.text += "(%dms)" % Network.delta_latency
|
||||
|
||||
func get_move_direction() -> Vector3:
|
||||
var input_dir := Vector2(
|
||||
|
||||
Reference in New Issue
Block a user