26 lines
757 B
GDScript
26 lines
757 B
GDScript
extends Node3D
|
|
|
|
@export_enum("Enemy", "Trap") var enemy_type: int
|
|
@export var damage : float = 1
|
|
@export var pushback : float = 5
|
|
@export var taunts : Array[String] = []
|
|
|
|
@onready var outline_meshes = [$Spikes1/MeshInstance3D]
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
pass # Replace with function body.
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
pass
|
|
|
|
func _on_area_3d_body_entered(body: Node3D) -> void:
|
|
if body.is_in_group("player"):
|
|
if HelperFuncs.angle_velocity_aligned(self,Vector3(0,-1,0),body,Vector3(.7,.7,.7)):
|
|
body.hit(damage,self,enemy_type)
|
|
var bounce_velocity = -body.velocity
|
|
body.velocity = bounce_velocity
|