2022-10-11 19:11:46 -04:00
|
|
|
extends KinematicBody
|
|
|
|
|
|
|
|
|
|
|
|
var hit_acceleration = 10
|
|
|
|
var hit_speed = 100
|
|
|
|
|
|
|
|
var velocity = Vector3()
|
|
|
|
var movement = Vector3()
|
|
|
|
var direction = Vector3()
|
|
|
|
var gravity_vec = Vector3()
|
|
|
|
|
|
|
|
func _physics_process(delta):
|
|
|
|
|
|
|
|
velocity = velocity.linear_interpolate(direction * hit_speed, hit_acceleration * delta)
|
|
|
|
|
|
|
|
movement.x = velocity.x
|
|
|
|
movement.y = velocity.y
|
|
|
|
movement.z = velocity.z
|
|
|
|
|
|
|
|
move_and_slide(movement, Vector3.UP)
|
|
|
|
|
|
|
|
func get_slapped(slap_level, slap_vector):
|
|
|
|
direction = slap_vector
|
2022-10-11 19:54:40 -04:00
|
|
|
|
|
|
|
func get_shot():
|
|
|
|
queue_free()
|