jus: rajout de juyce commes ils disent

Une petit trainée de particules suit la princesse, quand elle marche et
change de direction, quand elle saute, quand elle wall kick. C'est fou
mais rien que ce petit truc rend le jeu plus agréable à jouer!!
This commit is contained in:
Thomas Lavocat
2023-10-15 14:35:00 +02:00
parent 362cec2bee
commit 79d664d0d4
4 changed files with 64 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ var gravity: int = ProjectSettings.get("physics/2d/default_gravity")
@onready var death_animation := $"Death player" as AnimationPlayer
@onready var nuage_prout := $"GPUParticles2D" as GPUParticles2D
@onready var nuage_jump := $"GPUParticles2DJump" as GPUParticles2D
################################################################################
#
@@ -437,6 +438,8 @@ func read_input() -> void:
if need_kicking and get_coyote(coyote_grab):
if not kicking:
need_kicking=false
nuage_jump.restart()
nuage_jump.emitting = true
kicking=true
coyote_grab = [false]
last_kick_key_counter = 0
@@ -450,6 +453,8 @@ func read_input() -> void:
if need_jump and (is_on_floor() or get_coyote(coyote_ground)):
need_jump = false
if not jumping:
nuage_jump.restart()
nuage_jump.emitting = true
jumping = true
jumping_step = JUMP_SPEED_TABLE.size()-1
@@ -472,8 +477,14 @@ func read_input() -> void:
)
if not is_zero_approx(axis):
if axis < 0:
if direction == 1 and is_on_floor():
nuage_jump.restart()
nuage_jump.emitting = true
direction = -1
else:
if direction == -1 and is_on_floor():
nuage_jump.restart()
nuage_jump.emitting = true
direction = 1
else:
if kicking: