diff --git a/EnemyProjectile.gd b/ai/EnemyProjectile.gd similarity index 100% rename from EnemyProjectile.gd rename to ai/EnemyProjectile.gd diff --git a/ai/SpinningBone.gd b/ai/SpinningBone.gd index 6f5757a..f11e1ba 100644 --- a/ai/SpinningBone.gd +++ b/ai/SpinningBone.gd @@ -5,6 +5,6 @@ func launch_right(): func launch_left(): launch_vector(Vector2.LEFT) func launch_upleft(): - launch_vector(Vector2(-1, -1)) + launch_vector(Vector2.LEFT + Vector2.UP) func launch_upright(): - velocity = (Vector2(1, -1)) + launch_vector(Vector2.RIGHT + Vector2.UP) diff --git a/ai/SpinningBone.tscn b/ai/SpinningBone.tscn index 86af9a5..c630294 100644 --- a/ai/SpinningBone.tscn +++ b/ai/SpinningBone.tscn @@ -24,7 +24,7 @@ tracks/0/keys = { radius = 3.0 height = 2.0 -[node name="KinematicBody2D" type="KinematicBody2D"] +[node name="Bone" type="KinematicBody2D"] collision_layer = 16 collision_mask = 11 script = ExtResource( 2 ) diff --git a/levels/test.tscn b/levels/test.tscn index 7637d89..bd419b9 100644 --- a/levels/test.tscn +++ b/levels/test.tscn @@ -17,4 +17,4 @@ position = Vector2( 60, 176 ) position = Vector2( 67, 168 ) [node name="Skeleton Enemy" parent="." instance=ExtResource( 4 )] -position = Vector2( 291, 166 ) +position = Vector2( 274, 164 ) diff --git a/project.godot b/project.godot index 76b9d52..7eaf3f7 100644 --- a/project.godot +++ b/project.godot @@ -22,7 +22,7 @@ _global_script_classes=[ { "base": "KinematicBody2D", "class": "EnemyProjectile", "language": "GDScript", -"path": "res://EnemyProjectile.gd" +"path": "res://ai/EnemyProjectile.gd" }, { "base": "KinematicBody2D", "class": "Projectile", diff --git a/script/Skeleton Enemy.gd b/script/Skeleton Enemy.gd index 42ac5a5..af6fd1a 100644 --- a/script/Skeleton Enemy.gd +++ b/script/Skeleton Enemy.gd @@ -56,6 +56,9 @@ func _physics_process(_delta): elif velocity.x < 0: $Skeleton.flip_h = true + if health <= 0: + queue_free() + if is_on_wall() and is_on_floor(): velocity.y = -150