Mob Death: Line Doesn't Point to Dead

main
Luna Brovchuk 2023-10-01 20:39:25 +02:00
parent ea0172c66d
commit 34e40a666e
2 changed files with 4 additions and 4 deletions

View File

@ -5,10 +5,10 @@
[ext_resource path="res://res/shaders/colorize.tres" type="Material" id=3] [ext_resource path="res://res/shaders/colorize.tres" type="Material" id=3]
[sub_resource type="RectangleShape2D" id=1] [sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 3.5, 3.5 ) extents = Vector2( 4, 4 )
[sub_resource type="RectangleShape2D" id=2] [sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 3.5, 9 ) extents = Vector2( 7, 11 )
[sub_resource type="Animation" id=4] [sub_resource type="Animation" id=4]
resource_name = "RESET" resource_name = "RESET"
@ -48,7 +48,7 @@ tracks/0/loop_wrap = true
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
tracks/0/keys = { tracks/0/keys = {
"times": PoolRealArray( 0, 2 ), "times": PoolRealArray( 0, 0.9 ),
"transitions": PoolRealArray( 1, 1 ), "transitions": PoolRealArray( 1, 1 ),
"update": 1, "update": 1,
"values": [ true, false ] "values": [ true, false ]

View File

@ -79,7 +79,7 @@ func _shoot():
bullet.global_position.y = self.global_position.y + 8 bullet.global_position.y = self.global_position.y + 8
func _draw(): func _draw():
if target != null and is_instance_valid(target): if target != null and is_instance_valid(target) and not target.dead:
var dist2enemy = position.distance_to(target.global_position) var dist2enemy = position.distance_to(target.global_position)
var mob_offset = Vector2.ZERO var mob_offset = Vector2.ZERO
if target.is_in_group("bat"): if target.is_in_group("bat"):