diff --git a/src/models/enemies/ghost/Ghost.tscn b/src/models/enemies/ghost/Ghost.tscn index 13e0c74..df33a2d 100644 --- a/src/models/enemies/ghost/Ghost.tscn +++ b/src/models/enemies/ghost/Ghost.tscn @@ -25,7 +25,7 @@ flip_h = true use_parent_material = true frames = ExtResource( 1 ) animation = "idle" -frame = 4 +frame = 1 playing = true centered = false diff --git a/src/models/player/Player.tscn b/src/models/player/Player.tscn index 77b9f7f..e6e7505 100644 --- a/src/models/player/Player.tscn +++ b/src/models/player/Player.tscn @@ -5,10 +5,10 @@ [ext_resource path="res://res/shaders/colorize.tres" type="Material" id=3] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 3.5, 3.5 ) +extents = Vector2( 4, 4 ) [sub_resource type="RectangleShape2D" id=2] -extents = Vector2( 3.5, 9 ) +extents = Vector2( 7, 11 ) [sub_resource type="Animation" id=4] resource_name = "RESET" @@ -48,7 +48,7 @@ tracks/0/loop_wrap = true tracks/0/imported = false tracks/0/enabled = true tracks/0/keys = { -"times": PoolRealArray( 0, 2 ), +"times": PoolRealArray( 0, 0.9 ), "transitions": PoolRealArray( 1, 1 ), "update": 1, "values": [ true, false ] diff --git a/src/models/player/player.gd b/src/models/player/player.gd index 2fc668c..40adc42 100644 --- a/src/models/player/player.gd +++ b/src/models/player/player.gd @@ -129,7 +129,7 @@ func _physics_process(delta): velocity = move_and_slide(velocity * speed_multiplier) choose_target() - if target != null and is_instance_valid(target): + if target != null and is_instance_valid(target) and not target.dead: target.material = outline_material if recharge_timer >= get_recharge(): diff --git a/src/scripts/enemy_class.gd b/src/scripts/enemy_class.gd index 576905c..424fbb1 100644 --- a/src/scripts/enemy_class.gd +++ b/src/scripts/enemy_class.gd @@ -12,6 +12,7 @@ var frozen_time = 2 var poisoned_time = 3 var poisoned_damage = 5 var poison_damage_timer = .0 +var death_position var frozen = false @@ -22,6 +23,8 @@ func deal_damage(amount): func death(): dead = true + $Sprite.playing = false + death_position = self.global_position $Area2D.call_deferred("free") remove_from_group("enemy") material = empty_material @@ -29,6 +32,7 @@ func death(): func _physics_process(delta): if dead: + self.global_position = death_position dead_timer += delta $Sprite.modulate.a = 1 - (dead_timer / 2) if dead_timer >= 2.0: