fix post-proto

* ajout d'un fondu de musique au changement de phase
* résolution de bugs en tout genre
This commit is contained in:
2025-11-14 16:43:52 +01:00
parent d3ea21e212
commit dbe8f03531
37 changed files with 411 additions and 147 deletions

View File

@@ -1,60 +1,55 @@
[gd_scene load_steps=22 format=3 uid="uid://3ss8pvhsackj"]
[gd_scene load_steps=21 format=3 uid="uid://3ss8pvhsackj"]
[ext_resource type="PackedScene" uid="uid://753270jjxmfg" path="res://gui/game/card/card.tscn" id="1_we78f"]
[ext_resource type="Shader" uid="uid://bqjwmomh851lc" path="res://common/vfx/materials/shaders/skew.gdshader" id="1_x54se"]
[ext_resource type="Texture2D" uid="uid://0hbdgalf04e" path="res://common/icons/wood.svg" id="2_bw03i"]
[ext_resource type="Script" uid="uid://dj5pld5ragrjp" path="res://gui/game/card/scripts/card_visualiser.gd" id="2_ntbk8"]
[ext_resource type="Script" uid="uid://dj2pv1hiwjfv0" path="res://gui/game/card/scripts/card_info.gd" id="3_5yk1o"]
[ext_resource type="Texture2D" uid="uid://bd6qddv5ihkjr" path="res://common/icons/bucket.svg" id="3_r0jrf"]
[ext_resource type="Script" uid="uid://dgbh38j13g5kn" path="res://gui/game/card/scripts/card_section_info.gd" id="4_7xkgc"]
[ext_resource type="Script" uid="uid://b4tkium34c831" path="res://gui/game/card/scripts/card_stat_info.gd" id="5_1et8x"]
[ext_resource type="Texture2D" uid="uid://cgefjpkvs8noj" path="res://common/icons/copy.svg" id="5_lj1tr"]
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="7_1et8x"]
[ext_resource type="Texture2D" uid="uid://df0y0s666ui4h" path="res://icon.png" id="7_6vah0"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_r0jrf"]
shader = ExtResource("1_x54se")
shader_parameter/fov = 90.0
shader_parameter/cull_back = true
shader_parameter/y_rot = -6e-45
shader_parameter/x_rot = -6e-45
shader_parameter/inset = 0.0
[sub_resource type="Resource" id="Resource_r0jrf"]
script = ExtResource("4_7xkgc")
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
[sub_resource type="Resource" id="Resource_6vah0"]
script = ExtResource("4_7xkgc")
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
[sub_resource type="Resource" id="Resource_jjqcm"]
script = ExtResource("4_7xkgc")
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
[sub_resource type="Resource" id="Resource_lj1tr"]
script = ExtResource("4_7xkgc")
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
[sub_resource type="Resource" id="Resource_vabmf"]
script = ExtResource("4_7xkgc")
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
[sub_resource type="Resource" id="Resource_1vjtn"]
script = ExtResource("4_7xkgc")
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="7_vabmf"]
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="8_1vjtn"]
[sub_resource type="Resource" id="Resource_l3vvu"]
script = ExtResource("4_7xkgc")
title_text = "Very nice section"
title_icon = ExtResource("5_lj1tr")
text = "It's a very nice section with a very nice text"
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
[sub_resource type="Resource" id="Resource_bw03i"]
[sub_resource type="Resource" id="Resource_biqg7"]
script = ExtResource("5_1et8x")
text = "Dna"
icon = ExtResource("7_vabmf")
metadata/_custom_type_script = "uid://b4tkium34c831"
[sub_resource type="Resource" id="Resource_gskac"]
script = ExtResource("5_1et8x")
text = "Growth"
icon = ExtResource("8_1vjtn")
metadata/_custom_type_script = "uid://b4tkium34c831"
[sub_resource type="Resource" id="Resource_eb1v6"]
script = ExtResource("3_5yk1o")
title = "Hello"
texture = ExtResource("7_6vah0")
important_stat_text = "6"
important_stat_icon = ExtResource("3_r0jrf")
sections = Array[ExtResource("4_7xkgc")]([SubResource("Resource_r0jrf"), SubResource("Resource_6vah0"), SubResource("Resource_jjqcm"), SubResource("Resource_lj1tr"), SubResource("Resource_vabmf"), SubResource("Resource_1vjtn"), SubResource("Resource_l3vvu")])
important_stat_text = "5"
important_stat_icon = ExtResource("2_bw03i")
stats = Array[ExtResource("5_1et8x")]([SubResource("Resource_biqg7"), SubResource("Resource_gskac")])
sections = Array[ExtResource("4_7xkgc")]([SubResource("Resource_l3vvu")])
metadata/_custom_type_script = "uid://dj2pv1hiwjfv0"
[sub_resource type="ShaderMaterial" id="ShaderMaterial_bw03i"]
shader = ExtResource("1_x54se")
shader_parameter/fov = 90.0
shader_parameter/cull_back = true
shader_parameter/y_rot = 0.00018062632
shader_parameter/x_rot = -0.00042293756
shader_parameter/inset = 0.0
[sub_resource type="Animation" id="Animation_1et8x"]
length = 0.3
@@ -68,27 +63,35 @@ _data = {
&"appear": SubResource("Animation_7xkgc")
}
[node name="CardVisualiser" type="SubViewportContainer"]
material = SubResource("ShaderMaterial_r0jrf")
[node name="CardVisualiser" type="MarginContainer"]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -246.0
offset_top = -134.0
offset_right = 54.0
offset_bottom = -24.0
offset_left = -125.0
offset_top = -30.0
offset_right = 125.0
offset_bottom = 30.0
grow_horizontal = 2
grow_vertical = 2
scale = Vector2(1.0000002, 1.0000002)
size_flags_horizontal = 0
size_flags_vertical = 4
mouse_filter = 2
theme_override_constants/margin_left = -25
theme_override_constants/margin_top = -25
theme_override_constants/margin_right = -25
theme_override_constants/margin_bottom = -25
script = ExtResource("2_ntbk8")
card_info = SubResource("Resource_bw03i")
card_info = SubResource("Resource_eb1v6")
[node name="SubViewport" type="SubViewport" parent="."]
[node name="SubViewportContainer" type="SubViewportContainer" parent="."]
unique_name_in_owner = true
material = SubResource("ShaderMaterial_bw03i")
layout_mode = 2
[node name="SubViewport" type="SubViewport" parent="SubViewportContainer"]
unique_name_in_owner = true
transparent_bg = true
handle_input_locally = false
@@ -96,7 +99,7 @@ size = Vector2i(300, 110)
size_2d_override_stretch = true
render_target_update_mode = 4
[node name="CardContainer" type="MarginContainer" parent="SubViewport"]
[node name="CardContainer" type="MarginContainer" parent="SubViewportContainer/SubViewport"]
unique_name_in_owner = true
offset_right = 300.0
offset_bottom = 110.0
@@ -105,15 +108,14 @@ theme_override_constants/margin_top = 25
theme_override_constants/margin_right = 25
theme_override_constants/margin_bottom = 25
[node name="Card" parent="SubViewport/CardContainer" instance=ExtResource("1_we78f")]
[node name="Card" parent="SubViewportContainer/SubViewport/CardContainer" instance=ExtResource("1_we78f")]
unique_name_in_owner = true
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
size_flags_horizontal = 4
mouse_filter = 2
small_mode = true
down_arrow = true
info = SubResource("Resource_bw03i")
info = SubResource("Resource_eb1v6")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true

View File

@@ -1,5 +1,5 @@
@tool
extends SubViewportContainer
extends MarginContainer
class_name CardVisualiser
signal clicked(c: CardVisualiser)
@@ -7,6 +7,8 @@ signal clicked(c: CardVisualiser)
const MAX_ROT = 15
const ZOOM_SCALE = 1.2
const MARGIN = 25
var wanted_rot : Vector2 = Vector2.ZERO
var real_rot : Vector2 = Vector2.ZERO
@@ -51,7 +53,7 @@ func _input(event):
clicked.emit(self)
func _ready():
material = material.duplicate()
%SubViewportContainer.material = %SubViewportContainer.material.duplicate()
update()
is_ready = true
@@ -69,13 +71,14 @@ func _process(_d):
real_rot = real_rot.lerp(wanted_rot, 0.1)
material.set_shader_parameter("y_rot", - real_rot.x)
material.set_shader_parameter("x_rot", real_rot.y)
%SubViewportContainer.material.set_shader_parameter("y_rot", - real_rot.x)
%SubViewportContainer.material.set_shader_parameter("x_rot", real_rot.y)
%Card.custom_minimum_size.x = card_width
%CardContainer.size.y = 0
%CardContainer.size = Vector2.ZERO
%SubViewport.size = %CardContainer.size
size = %SubViewport.size
%SubViewportContainer.size = %SubViewport.size
size = %SubViewportContainer.size - (Vector2.ONE * MARGIN * 2)
func is_mouse_over() -> bool:

View File

@@ -165,6 +165,19 @@ texture = ExtResource("3_m0ja8")
expand_mode = 1
stretch_mode = 4
[node name="ParticleTexture2" type="TextureRect" parent="CenterContainer/ItemTexture"]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_top = -22.0
offset_right = 22.0
grow_vertical = 0
texture = ExtResource("3_m0ja8")
expand_mode = 1
stretch_mode = 4
[node name="BottomSpace" type="Control" parent="."]
layout_mode = 2

View File

@@ -39,12 +39,16 @@ func update(_item: Item, selected : bool):
if item and item.icon:
%ItemTexture.texture = item.icon
var particles = item.get_particles()
if len(particles):
if len(particles) > 0:
%ParticleTexture.texture = particles[0].texture
%ParticleTexture.modulate = particles[0].color
if len(particles) > 1:
%ParticleTexture2.texture = particles[1].texture
%ParticleTexture2.modulate = particles[1].color
%ItemTexture.visible = item != null
%NoItemTextureRect.visible = item == null
%ParticleTexture.visible = item and len(item.get_particles())
%ParticleTexture.visible = item and len(item.get_particles())>0
%ParticleTexture2.visible = item and len(item.get_particles())>1
current_item = item

View File

@@ -15,10 +15,12 @@ func _ready():
func show_rewards():
showing_rewards = true
get_tree().paused = true
%AnimationPlayer.play("show")
func hide_rewards():
showing_rewards = false
get_tree().paused = false
%AnimationPlayer.play_backwards("show")
func generate_rewards(nb : int = 3):

View File

@@ -70,7 +70,7 @@ func _on_plant_gaining_score(plant: Plant, amount : int):
0.8
)
await get_tree().create_timer(0.3).timeout
await get_tree().create_timer(0.3 / max(1,i)).timeout
func spawn_score_particle(
from_position,

View File

@@ -1,6 +1,6 @@
extends Control
const PLANET_RUN_SCENE = preload("res://stages/planet_run/planet_run.tscn")
@export_file var game_scene_path : String
func _ready():
visible = false
@@ -13,7 +13,7 @@ func win(planet : Planet):
func _on_restart_pressed():
GameInfo.game_data.reset_all()
get_tree().paused = false
get_tree().change_scene_to_packed(PLANET_RUN_SCENE)
get_tree().change_scene_to_file(game_scene_path)
func _on_quit_pressed():
get_tree().quit()

View File

@@ -27,6 +27,7 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_sehw2")
game_scene_path = "uid://d28cp7a21kwou"
[node name="ColorRect" type="ColorRect" parent="."]
material = SubResource("ShaderMaterial_8p3aj")

View File

@@ -1 +1,48 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#ffffff" class="icon icon-tabler icons-tabler-filled icon-tabler-pointer"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3.039 4.277l3.904 13.563c.185 .837 .92 1.516 1.831 1.642l.17 .016a2.2 2.2 0 0 0 1.982 -1.006l.045 -.078l1.4 -2.072l4.05 4.05a2.067 2.067 0 0 0 2.924 0l1.047 -1.047c.388 -.388 .606 -.913 .606 -1.461l-.008 -.182a2.067 2.067 0 0 0 -.598 -1.28l-4.047 -4.048l2.103 -1.412c.726 -.385 1.18 -1.278 1.053 -2.189a2.2 2.2 0 0 0 -1.701 -1.845l-13.524 -3.89a1 1 0 0 0 -1.236 1.24z" /></svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="#ffffff"
class="icon icon-tabler icons-tabler-filled icon-tabler-pointer"
version="1.1"
id="svg2"
sodipodi:docname="pointer.svg"
inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs2" />
<sodipodi:namedview
id="namedview2"
pagecolor="#505050"
bordercolor="#ffffff"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="1"
inkscape:deskcolor="#505050"
inkscape:zoom="16"
inkscape:cx="7.84375"
inkscape:cy="20.3125"
inkscape:window-width="1920"
inkscape:window-height="1009"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
<path
stroke="none"
d="M0 0h24v24H0z"
fill="none"
id="path1" />
<path
d="m 3.0398163,7.2791792 3.904,13.5629998 c 0.185,0.837 0.92,1.516 1.831,1.642 l 0.17,0.016 a 2.2,2.2 0 0 0 1.9819997,-1.006 l 0.045,-0.078 1.4,-2.072 4.05,4.05 a 2.067,2.067 0 0 0 2.924,0 l 1.047,-1.047 c 0.388,-0.388 0.606,-0.913 0.606,-1.461 l -0.008,-0.182 a 2.067,2.067 0 0 0 -0.598,-1.28 l -4.047,-4.048 2.103,-1.412 c 0.726,-0.385 1.18,-1.278 1.053,-2.189 a 2.2,2.2 0 0 0 -1.701,-1.8449997 L 4.2768163,6.0401792 a 1,1 0 0 0 -1.236,1.24 z"
id="path3"
style="fill:#000000;fill-opacity:0.286567" />
<path
d="M3.039 4.277l3.904 13.563c.185 .837 .92 1.516 1.831 1.642l.17 .016a2.2 2.2 0 0 0 1.982 -1.006l.045 -.078l1.4 -2.072l4.05 4.05a2.067 2.067 0 0 0 2.924 0l1.047 -1.047c.388 -.388 .606 -.913 .606 -1.461l-.008 -.182a2.067 2.067 0 0 0 -.598 -1.28l-4.047 -4.048l2.103 -1.412c.726 -.385 1.18 -1.278 1.053 -2.189a2.2 2.2 0 0 0 -1.701 -1.845l-13.524 -3.89a1 1 0 0 0 -1.236 1.24z"
id="path2" />
</svg>

Before

Width:  |  Height:  |  Size: 607 B

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/pointer.svg-7e9852b8fc87e59d7ede00033ef3f170.
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
@@ -25,6 +27,10 @@ mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=15 format=3 uid="uid://0yr6b2jtuttm"]
[gd_scene load_steps=23 format=3 uid="uid://0yr6b2jtuttm"]
[ext_resource type="Script" uid="uid://vhumsfntpqcl" path="res://gui/pointer/scripts/pointer.gd" id="1_1pe2k"]
[ext_resource type="Texture2D" uid="uid://bspffyprdywgc" path="res://gui/pointer/assets/cursors/pointer.svg" id="2_q4bvb"]
@@ -8,21 +8,51 @@
[ext_resource type="Script" uid="uid://c60a1bjcuj4hd" path="res://common/vfx/circle/scripts/circle.gd" id="5_b4uwv"]
[ext_resource type="PackedScene" uid="uid://3ss8pvhsackj" path="res://gui/game/card/card_visualiser.tscn" id="6_7j4mj"]
[ext_resource type="Shader" uid="uid://bqjwmomh851lc" path="res://common/vfx/materials/shaders/skew.gdshader" id="7_wgcdp"]
[ext_resource type="Texture2D" uid="uid://0hbdgalf04e" path="res://common/icons/wood.svg" id="8_tdpeg"]
[ext_resource type="Script" uid="uid://dj2pv1hiwjfv0" path="res://gui/game/card/scripts/card_info.gd" id="8_xb313"]
[ext_resource type="Script" uid="uid://dgbh38j13g5kn" path="res://gui/game/card/scripts/card_section_info.gd" id="9_s1ym6"]
[ext_resource type="Script" uid="uid://b4tkium34c831" path="res://gui/game/card/scripts/card_stat_info.gd" id="10_d4v46"]
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="11_s1ym6"]
[ext_resource type="Texture2D" uid="uid://cgefjpkvs8noj" path="res://common/icons/copy.svg" id="11_tof6i"]
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="13_mw4ws"]
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="14_efnoc"]
[ext_resource type="Texture2D" uid="uid://df0y0s666ui4h" path="res://icon.png" id="15_dtmaq"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_6eft6"]
shader = ExtResource("7_wgcdp")
shader_parameter/fov = 90.0
shader_parameter/cull_back = true
shader_parameter/y_rot = -6e-45
shader_parameter/x_rot = -6e-45
shader_parameter/y_rot = -5.999999999999999e-45
shader_parameter/x_rot = -5.999999999999999e-45
shader_parameter/inset = 0.0
[sub_resource type="Resource" id="Resource_mrxa2"]
[sub_resource type="Resource" id="Resource_l3vvu"]
script = ExtResource("9_s1ym6")
title_text = "Very nice section"
title_icon = ExtResource("11_tof6i")
text = "It's a very nice section with a very nice text"
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
[sub_resource type="Resource" id="Resource_biqg7"]
script = ExtResource("10_d4v46")
text = "Dna"
icon = ExtResource("13_mw4ws")
metadata/_custom_type_script = "uid://b4tkium34c831"
[sub_resource type="Resource" id="Resource_gskac"]
script = ExtResource("10_d4v46")
text = "Growth"
icon = ExtResource("14_efnoc")
metadata/_custom_type_script = "uid://b4tkium34c831"
[sub_resource type="Resource" id="Resource_mbe2a"]
script = ExtResource("8_xb313")
title = "Hello"
texture = ExtResource("15_dtmaq")
important_stat_text = "5"
important_stat_icon = ExtResource("8_tdpeg")
stats = Array[ExtResource("10_d4v46")]([SubResource("Resource_biqg7"), SubResource("Resource_gskac")])
sections = Array[ExtResource("9_s1ym6")]([SubResource("Resource_l3vvu")])
metadata/_custom_type_script = "uid://dj2pv1hiwjfv0"
[node name="Pointer" type="Node"]
@@ -123,8 +153,9 @@ modulate = Color(1, 1, 1, 0.5003133)
material = SubResource("ShaderMaterial_6eft6")
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 8
mouse_filter = 0
card_info = SubResource("Resource_mrxa2")
card_info = SubResource("Resource_mbe2a")
[node name="Audio" type="Node" parent="."]

View File

@@ -8,7 +8,7 @@ const ZONE_ACTIVATED_COLOR = Color.TURQUOISE
const ZONE_DEACTIVATED_COLOR = Color.REBECCA_PURPLE
const CARD_VISUALISATION_TIME = 0.5
const CARD_UP_PADDING = 20
const CARD_UP_PADDING = 50
@export var default_cursor : Texture2D
@@ -101,7 +101,11 @@ func inspect(node : Node):
update_inspector()
func update_card():
if not inspected or inspected_card_info == null or time_last_inspected > CARD_VISUALISATION_TIME:
if (
not inspected or inspected_card_info == null
or time_last_inspected > CARD_VISUALISATION_TIME
or get_tree().paused
):
%CardVisualiser.hide()
elif inspected != null and (