Fixed skelly for real

This commit is contained in:
Logan 2020-07-20 14:30:58 -05:00
parent 260372e703
commit 603b6291d0
6 changed files with 8 additions and 5 deletions

View file

@ -5,6 +5,6 @@ func launch_right():
func launch_left(): func launch_left():
launch_vector(Vector2.LEFT) launch_vector(Vector2.LEFT)
func launch_upleft(): func launch_upleft():
launch_vector(Vector2(-1, -1)) launch_vector(Vector2.LEFT + Vector2.UP)
func launch_upright(): func launch_upright():
velocity = (Vector2(1, -1)) launch_vector(Vector2.RIGHT + Vector2.UP)

View file

@ -24,7 +24,7 @@ tracks/0/keys = {
radius = 3.0 radius = 3.0
height = 2.0 height = 2.0
[node name="KinematicBody2D" type="KinematicBody2D"] [node name="Bone" type="KinematicBody2D"]
collision_layer = 16 collision_layer = 16
collision_mask = 11 collision_mask = 11
script = ExtResource( 2 ) script = ExtResource( 2 )

View file

@ -17,4 +17,4 @@ position = Vector2( 60, 176 )
position = Vector2( 67, 168 ) position = Vector2( 67, 168 )
[node name="Skeleton Enemy" parent="." instance=ExtResource( 4 )] [node name="Skeleton Enemy" parent="." instance=ExtResource( 4 )]
position = Vector2( 291, 166 ) position = Vector2( 274, 164 )

View file

@ -22,7 +22,7 @@ _global_script_classes=[ {
"base": "KinematicBody2D", "base": "KinematicBody2D",
"class": "EnemyProjectile", "class": "EnemyProjectile",
"language": "GDScript", "language": "GDScript",
"path": "res://EnemyProjectile.gd" "path": "res://ai/EnemyProjectile.gd"
}, { }, {
"base": "KinematicBody2D", "base": "KinematicBody2D",
"class": "Projectile", "class": "Projectile",

View file

@ -56,6 +56,9 @@ func _physics_process(_delta):
elif velocity.x < 0: elif velocity.x < 0:
$Skeleton.flip_h = true $Skeleton.flip_h = true
if health <= 0:
queue_free()
if is_on_wall() and is_on_floor(): if is_on_wall() and is_on_floor():
velocity.y = -150 velocity.y = -150