From 79d664d0d4e12e31edd83bf0094ff7128b4d28fb Mon Sep 17 00:00:00 2001 From: Thomas Lavocat Date: Sun, 15 Oct 2023 14:35:00 +0200 Subject: [PATCH] jus: rajout de juyce commes ils disent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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!! --- masks/smoke_particle_6.png | Bin 0 -> 4390 bytes masks/smoke_particle_6.png.import | 34 ++++++++++++++++++++++++++++++ princesse.gd | 11 ++++++++++ princesse.tscn | 21 ++++++++++++++++-- 4 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 masks/smoke_particle_6.png create mode 100644 masks/smoke_particle_6.png.import diff --git a/masks/smoke_particle_6.png b/masks/smoke_particle_6.png new file mode 100644 index 0000000000000000000000000000000000000000..3a6e8ae049eefe60330ccee95d6d897bb59624d8 GIT binary patch literal 4390 zcmeHKeQXnD7{AU5W6%jQ1qmj{F_{9_`{?!K&K1OUuns!PRs|LyT<_j1$J$=KyRGe* zV8E}12>20H82Ayz`GJBTLkV zwM=;Dwb?rtX{9;aD_&0oh-so+Sm^T<7WPB~ zW2oPI(1 zstG>4{9tm*#+K)Ioqg-2E9a&@Hg8mM@-61ej$7ZkX{QypHcz&nx%_ioeA2GwJoCP} zt$WE~=FN+Vy8Nc~Z+zmNQbMfQ_TG_w$Ln(zhaR6Zc69l78@IL9x9%XSzB-$D8Qrko z-R8BGt5YT)JEl%;TdQy0v}eoY_uhW)m4f{p^stM09ZceduB%I~eB5B)zCCdwx$QNFpoA^F zs04r|9*)AQK#+pz@hC4;0v!#2pd4{wXLdJYs4Tj$`8F@ zirDmN*#&V95`=-yqw#PkqH%E-mg42$yD?2*XbPfNy08UaA6lrW0A(zUg~W^Eay5-j z%SH=SQR2$nGrK9^$b~J_^(aRWu~^I!vsx52NKh=x5+qH~G!7BCmWb$l9FJ%d4T>~} z8)$+mM|D|=pav%&P^xqnhQW2T$G>pY>+PkFXx%D6J%~6TB`6C?gu_H%3r#Poh9un% zUDrbM!yY2afTmQb0w}5m5q)A`3Q_2_k5;LnR5+qQfDi~ns0MeX`fWMOXh&RZzFNmE&)K3v{hi3K2)BFrt=X27*vqlB10ZZU;-i|(Ku~q zC7hvo5$AybDI_b&I&CZ!aDqM*b5$8uB_HbRl|dy!Drf*4tOy&=K|(4Uu;EU?Sn+@r z1SHnMGYmzhs6>IAsi{CdZBm3YLQI-<_ zhBn#-Y=}~$Zl2gruqN%pvcp)8v##aL|q12h1Rw0OPjnj+~jUIjCPP)Dd0 zEYOrz=-u6^x~IQ4v1P!>1C$J>NSw0zX_8~C9L-|HjStT%IPF%3g7HX{6K5z2;7(`2 zfs3@mCJMmHl1@i|cmHE}y%pi;39o=K4#b{h77+hPcN);=1ckDs=itc<4|<~ar0>=X zrs76^y36cFZh@kMn+!iXa0%D#421QGZLF9vUd z&BVLUz*}TSVD>CG()GmpZyMofShRSdh9JY?)pPi06SAp(ESwywd%Q(Mli4}LM-b8h zZ4aDU=yA{RXZ>I*MRsCLNNRAwZWOzEv z8Q*4R{W0Wf`)!v@L$ikFU1$ueBHP literal 0 HcmV?d00001 diff --git a/masks/smoke_particle_6.png.import b/masks/smoke_particle_6.png.import new file mode 100644 index 0000000..699e878 --- /dev/null +++ b/masks/smoke_particle_6.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cfptwn1c03k1b" +path="res://.godot/imported/smoke_particle_6.png-be850fe985b6ee6e405abdda6d118021.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://masks/smoke_particle_6.png" +dest_files=["res://.godot/imported/smoke_particle_6.png-be850fe985b6ee6e405abdda6d118021.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/princesse.gd b/princesse.gd index f485e10..625c8c3 100644 --- a/princesse.gd +++ b/princesse.gd @@ -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: diff --git a/princesse.tscn b/princesse.tscn index fc7cb7a..7426088 100644 --- a/princesse.tscn +++ b/princesse.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=71 format=3 uid="uid://dv0mokf4eogm7"] +[gd_scene load_steps=73 format=3 uid="uid://dv0mokf4eogm7"] [ext_resource type="Script" path="res://princesse.gd" id="1_dkp7s"] [ext_resource type="Texture2D" uid="uid://dr7fyh2rufsyj" path="res://sprite/princess_falling_direction.png" id="2_hholp"] @@ -10,6 +10,7 @@ [ext_resource type="Texture2D" uid="uid://c2xtcu5ysgi7o" path="res://sprite/princess_jumping.png" id="6_srvje"] [ext_resource type="Texture2D" uid="uid://d23lmsjrjw1mk" path="res://sprite/princess_wall_stick.png" id="7_8dix4"] [ext_resource type="Texture2D" uid="uid://dgsn3ixn46anc" path="res://sprite/light.png" id="8_8c83t"] +[ext_resource type="Texture2D" uid="uid://cfptwn1c03k1b" path="res://masks/smoke_particle_6.png" id="11_4uqsf"] [sub_resource type="Gradient" id="Gradient_anx4x"] offsets = PackedFloat32Array(0, 0.99893) @@ -51,6 +52,13 @@ collision_mode = 1 collision_friction = 0.0 collision_bounce = 0.0 +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_3nyab"] +particle_flag_disable_z = true +direction = Vector3(0, 0, 0) +gravity = Vector3(0, 0, 0) +orbit_velocity_min = 0.0 +orbit_velocity_max = 0.0 + [sub_resource type="AtlasTexture" id="AtlasTexture_i248f"] atlas = ExtResource("2_hholp") region = Rect2(0, 0, 24, 50) @@ -489,10 +497,19 @@ lifetime = 2.0 preprocess = 2.0 speed_scale = 4.0 +[node name="GPUParticles2DJump" type="GPUParticles2D" parent="."] +position = Vector2(-1.66667, 25) +emitting = false +amount = 11 +process_material = SubResource("ParticleProcessMaterial_3nyab") +texture = ExtResource("11_4uqsf") +one_shot = true +speed_scale = 5.73 + [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] modulate = Color(0.823529, 0.823529, 0.823529, 1) sprite_frames = SubResource("SpriteFrames_q52wx") -animation = &"wall_stick" +animation = &"walk" [node name="Camera2D" type="Camera2D" parent="."] zoom = Vector2(2, 2)