disable sg2083 and pan camera over to fami when defeated

This commit is contained in:
Haze Weathers 2024-02-29 00:40:38 -05:00
parent 12d6adaf94
commit 3ff2f837d8
5 changed files with 32 additions and 4 deletions

View file

@ -1,6 +1,7 @@
extends Node2D
signal died()
signal health_changed(amount)
@ -45,10 +46,14 @@ func stop_push() -> void:
func hurt(amount: float) -> void:
if hp <= 0.0:
return
hp -= amount
hp = max(hp, 0.0)
emit_signal("health_changed", hp)
if hp <= 0.0:
state_chart.send_event("die")
emit_signal("died")
func _attack() -> void:

View file

@ -758,7 +758,7 @@ tracks/19/loop_wrap = true
tracks/19/imported = false
tracks/19/enabled = true
tracks/19/keys = {
"times": PoolRealArray( 0, 7 ),
"times": PoolRealArray( 0, 7.6 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ true, false ]
@ -1808,6 +1808,7 @@ linear_accel = -30.19
[node name="DissolveParticles" type="CPUParticles2D" parent="."]
material = ExtResource( 17 )
position = Vector2( 4, -8 )
z_index = -20
emitting = false
amount = 16
local_coords = false

View file

@ -65,7 +65,7 @@ func _physics_process(delta: float) -> void:
func _input(event: InputEvent) -> void:
if state == State.DEAD:
if state == State.DEAD or state == State.INACTIVE:
return
if event.is_action_pressed("shoot") and (state == State.STAND or state == State.FORWARD or state == State.BACK) and energy >= bullet_energy:
shoot()