Fixed minor particle issues.
This commit is contained in:
parent
9a09776900
commit
9d5fe34ad8
1 changed files with 4 additions and 3 deletions
|
|
@ -33,8 +33,10 @@ func _physics_process(delta: float) -> void:
|
|||
if Input.is_action_just_pressed("flip") and (is_on_floor() or is_on_ceiling()):
|
||||
al_globals.gravity *= -1
|
||||
|
||||
if velocity.y > 500:
|
||||
if velocity.y > 500 and not (is_on_floor() or is_on_ceiling()):
|
||||
particles.emitting = true
|
||||
else:
|
||||
particles.emitting = false
|
||||
|
||||
move_and_slide() #Allow physics control.
|
||||
spike_detection() #Checks for tiles with the "Spike" custom data enabled.
|
||||
|
|
@ -58,7 +60,7 @@ func death(fallen: bool) -> void:
|
|||
velocity.x = 0
|
||||
velocity.y = 0
|
||||
scale.x = lerp(scale.x, 0.0, 0.1)
|
||||
scale.y = lerp(scale.y, 0.0, 0.1)
|
||||
scale.y = lerp(scale.y, 0.0, 0.1)
|
||||
if al_globals.gravity < 0:
|
||||
al_globals.gravity *= -1
|
||||
await get_tree().create_timer(1.0).timeout
|
||||
|
|
@ -71,7 +73,6 @@ func respawn() -> void:
|
|||
position.x = level.startPosX
|
||||
position.y = level.startPosY
|
||||
|
||||
|
||||
func _on_visible_on_screen_notifier_2d_screen_exited() -> void:
|
||||
if !dead:
|
||||
death(true)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue