divers changements pour la sortie du second proto

* ajout du panneau solaire #54
* ajout d'un tutoriel #53
* equilibrage du jeu #73
* ajout d'un son pour l'annonce
This commit is contained in:
2025-09-26 16:56:35 +02:00
parent 6d0100d703
commit 099f8bb1be
56 changed files with 1129 additions and 87 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cqqlkm14lawpa"
path="res://.godot/imported/panneau_solaire_1.png-b9a4049f295152380ed394a82c03b8e2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://entities/interactables/machines/solar_pannel/assets/sprites/panneau_solaire_1.png"
dest_files=["res://.godot/imported/panneau_solaire_1.png-b9a4049f295152380ed394a82c03b8e2.ctex"]
[params]
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
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
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b1n8nad43usw4"
path="res://.godot/imported/panneau_solaire_2.png-479b68803815c59c599ff8c3a78ca895.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://entities/interactables/machines/solar_pannel/assets/sprites/panneau_solaire_2.png"
dest_files=["res://.godot/imported/panneau_solaire_2.png-479b68803815c59c599ff8c3a78ca895.ctex"]
[params]
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
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
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c22re5wfsm1ax"
path="res://.godot/imported/panneau_solaire_3.png-022ae039aa352e1519471d4f9c114a8b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://entities/interactables/machines/solar_pannel/assets/sprites/panneau_solaire_3.png"
dest_files=["res://.godot/imported/panneau_solaire_3.png-022ae039aa352e1519471d4f9c114a8b.ctex"]
[params]
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
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
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,49 @@
extends Machine
class_name SolarPanel
var charged : bool = false : set = set_charged
var recharge_days : int = 0
func get_days_to_recharge(l : int = level) -> int:
match l:
1: return 2
2: return 2
3: return 2
_: return 1
func get_energy_production(l : int = level) -> int:
match l:
1: return 1
2: return 2
3: return 3
_: return 1
# Méthode déclenchée par la classe planet
func _pass_day():
if not charged:
recharge_days += 1
print(get_days_to_recharge())
if recharge_days >= get_days_to_recharge():
set_charged(true)
func set_charged(_charged = true):
charged = _charged
recharge_days = 0
if charged:
%AnimationPlayer.play("charged")
else :
%AnimationPlayer.play_backwards("charged")
func setup_machine_sprite():
%Base.self_modulate = Machine.get_level_color(level)
func interact_text():
return "Recharge " + str(get_energy_production()) + " energy"
func can_interact(_p : Player) -> bool:
return charged
func interact(p : Player) -> bool:
p.recharge(get_energy_production())
set_charged(false)
return true

View File

@@ -0,0 +1 @@
uid://bjy8gc0eyl2ss

View File

@@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="MachineType" load_steps=3 format=3 uid="uid://dew3p4fffjryo"]
[ext_resource type="Script" uid="uid://bhncww816fjsb" path="res://entities/interactables/machines/scripts/machine_info.gd" id="1_ctita"]
[ext_resource type="PackedScene" uid="uid://gwq2oos6ljyp" path="res://entities/interactables/machines/solar_pannel/solar_pannel.tscn" id="1_naexs"]
[resource]
script = ExtResource("1_ctita")
name = "Solar Pannel"
scene = ExtResource("1_naexs")
description = "Produce energy evry 2 days. When charged, can be used to recharge energy."
metadata/_custom_type_script = "uid://bhncww816fjsb"

View File

@@ -0,0 +1,99 @@
[gd_scene load_steps=9 format=3 uid="uid://gwq2oos6ljyp"]
[ext_resource type="Script" uid="uid://bjy8gc0eyl2ss" path="res://entities/interactables/machines/solar_pannel/scripts/solar_pannel.gd" id="1_t4vnu"]
[ext_resource type="Texture2D" uid="uid://b1n8nad43usw4" path="res://entities/interactables/machines/solar_pannel/assets/sprites/panneau_solaire_2.png" id="2_ny3sb"]
[ext_resource type="Texture2D" uid="uid://cqqlkm14lawpa" path="res://entities/interactables/machines/solar_pannel/assets/sprites/panneau_solaire_1.png" id="3_bml32"]
[ext_resource type="Texture2D" uid="uid://c22re5wfsm1ax" path="res://entities/interactables/machines/solar_pannel/assets/sprites/panneau_solaire_3.png" id="4_ob8kj"]
[sub_resource type="CircleShape2D" id="CircleShape2D_6utw7"]
radius = 48.0
[sub_resource type="Animation" id="Animation_gal8b"]
resource_name = "charged"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprites/Pannels:modulate")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.033333335, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0.42365062, 0.42365065, 0.42365062, 1), Color(1, 1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Sprites/Flair:modulate")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_77hon"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprites/Pannels:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(0.42352942, 0.42352942, 0.42352942, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Sprites/Flair:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_5vw1f"]
_data = {
&"RESET": SubResource("Animation_77hon"),
&"charged": SubResource("Animation_gal8b")
}
[node name="SolarPannel" type="Area2D"]
script = ExtResource("1_t4vnu")
metadata/_custom_type_script = "uid://du7qppxobx5nd"
[node name="Sprites" type="Node2D" parent="."]
position = Vector2(15.999999, -16.999998)
scale = Vector2(0.09, 0.09)
[node name="Pannels" type="Sprite2D" parent="Sprites"]
modulate = Color(0.42352942, 0.42352942, 0.42352942, 1)
texture = ExtResource("2_ny3sb")
[node name="Base" type="Sprite2D" parent="Sprites"]
unique_name_in_owner = true
texture = ExtResource("3_bml32")
[node name="Flair" type="Sprite2D" parent="Sprites"]
modulate = Color(1, 1, 1, 0)
texture = ExtResource("4_ob8kj")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(6, -23)
shape = SubResource("CircleShape2D_6utw7")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
&"": SubResource("AnimationLibrary_5vw1f")
}