This commit is contained in:
MarcEricMartel 2022-10-11 19:57:34 -04:00
commit 864b1f5e03
2 changed files with 17 additions and 50 deletions

View File

@ -1,6 +1,5 @@
extends KinematicBody
onready var animation_player = $AnimationPlayer
var hit_acceleration = 10
var hit_speed = 100
@ -21,5 +20,7 @@ func _physics_process(delta):
move_and_slide(movement, Vector3.UP)
func get_slapped(slap_level, slap_vector):
animation_player.play("head_wobble")
direction = slap_vector
func get_shot():
queue_free()

View File

@ -1,70 +1,36 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://BlenderStuff/protoenemy.obj" type="ArrayMesh" id=1]
[ext_resource path="res://Scripts/HitBox.gd" type="Script" id=1]
[ext_resource path="res://Scenes/Enemy.gd" type="Script" id=2]
[ext_resource path="res://Scripts/HurtBox.gd" type="Script" id=3]
[sub_resource type="BoxShape" id=1]
[sub_resource type="SphereMesh" id=6]
[sub_resource type="CapsuleShape" id=2]
height = 2.5
[sub_resource type="SphereShape" id=7]
[sub_resource type="CylinderShape" id=3]
[sub_resource type="SphereShape" id=8]
[sub_resource type="Animation" id=4]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("MeshInstance:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector3( 0, 0, -15 ) ]
}
[sub_resource type="Animation" id=5]
resource_name = "head_wobble"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("MeshInstance:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.3, 0.5 ),
"transitions": PoolRealArray( 1, 2.07053, 1, 0.482968 ),
"update": 0,
"values": [ Vector3( 0, 0, 0 ), Vector3( 0, 0, -15 ), Vector3( 0, 0, 15 ), Vector3( 0, 0, 0 ) ]
}
[sub_resource type="SphereShape" id=9]
[node name="Enemy" type="KinematicBody"]
script = ExtResource( 2 )
[node name="MeshInstance" type="MeshInstance" parent="."]
transform = Transform( 0.6, 0, 0, 0, 0.6, 0, 0, 0, 0.6, 0, 0, 0 )
mesh = ExtResource( 1 )
mesh = SubResource( 6 )
[node name="Head" type="Area" parent="."]
script = ExtResource( 3 )
[node name="HeadCollision" type="CollisionShape" parent="Head"]
transform = Transform( 0.432688, 0, 0, 0, 2.49394, 0, 0, 0, 0.432688, 0, -0.0876949, 0 )
shape = SubResource( 1 )
shape = SubResource( 7 )
[node name="EnemyCollision" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.094023, 0 )
shape = SubResource( 2 )
shape = SubResource( 8 )
[node name="EnemyFeet" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.59606, 0 )
shape = SubResource( 3 )
[node name="HitBox" type="Area" parent="."]
script = ExtResource( 1 )
hitbox_type = 2
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
reset_on_save = false
anims/RESET = SubResource( 4 )
anims/head_wobble = SubResource( 5 )
[node name="CollisionShape" type="CollisionShape" parent="HitBox"]
shape = SubResource( 9 )