Basic launch

This commit is contained in:
Victor Turgeon
2022-10-11 19:11:46 -04:00
parent 463f1c5cda
commit 82774ae786
8 changed files with 213 additions and 22 deletions

25
Scenes/Enemy.gd Normal file
View File

@@ -0,0 +1,25 @@
extends KinematicBody
onready var animation_player = $AnimationPlayer
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):
animation_player.play("head_wobble")
direction = slap_vector