Compare commits

2 Commits

31 changed files with 664 additions and 183 deletions

View File

@@ -0,0 +1,33 @@
shader_type canvas_item;
uniform sampler2D screen_texture: hint_screen_texture, repeat_disable, filter_linear_mipmap;
uniform float blur_radius : hint_range(0, 1) = 0.2; // Radius of the blur effect
uniform float blur_amount : hint_range(0, 5) = 1.0; // Strength of the blur effect
uniform float blur_inner : hint_range(0, 1) = 0.6; // Inner edge of the blur effect
uniform float blur_outer : hint_range(0, 1) = 0.66; // Outer edge of the blur effect
void fragment() {
// Original color of the pixel from the screen
vec4 pixelColor = texture(screen_texture, UV);
// Color with blur effect from the screen
vec4 blurColor = textureLod(screen_texture, SCREEN_UV, blur_amount);
// Calculate distance from the center of the screen
float distance = length(UV - vec2(0.5, 0.5));
// Apply smoothstep function to control transition between areas
float blur = smoothstep(blur_inner - blur_radius, blur_outer, distance);
// Mix colors of the blur effect and the original color based on the smoothstep value
pixelColor.rgb = mix(blurColor.rgb, COLOR.rgb, -blur);
// Set the alpha component of the blur effect to the smoothstep value
blurColor.a = blur;
// Mix colors of the blur effect with white for an additional effect
blurColor.rgb = mix(blurColor.rgb, vec3(1.0), 0.1);
// Set the final color to the modified color of the blur effect
COLOR = blurColor;
}

View File

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

View File

@@ -0,0 +1,40 @@
// Based on https://godotshaders.com/shader/screen-smoke-fog/
shader_type canvas_item;
render_mode blend_mix;
// Stuff related to camera position and offsets
uniform vec2 camera_position;
uniform vec2 camera_offset;
uniform float camera_position_speed: hint_range(0.0, 1.0) = 0.025;
uniform float camera_offset_speed: hint_range(0.0, 1.0) = 0.025;
// Uniforms for customization
uniform sampler2D noise_texture_1 : repeat_enable;
uniform sampler2D noise_texture_2 : repeat_enable;
uniform float noise_blend : hint_range(0.0, 1.0) = 1.0;
uniform float noise_speed_1 : hint_range(0.0, 1.0) = 1.0;
uniform float noise_speed_2 : hint_range(0.0, 1.0) = 1.0;
uniform vec2 noise_dir_1 = vec2(1.0,+1.0);
uniform vec2 noise_dir_2 = vec2(1.0,-1.0);
uniform vec3 smoke_color : source_color = vec3(0.8);
uniform float density : hint_range(0.0, 1.0) = 1.0;
void fragment() {
vec2 offset = ( (camera_position * camera_position_speed) + (camera_offset * camera_offset_speed) );
vec2 time_offset_1 = TIME * noise_dir_1 * noise_speed_1 * 0.1;
vec2 time_offset_2 = TIME * noise_dir_2 * noise_speed_2 * 0.1;
// Create distorted UV and sample final noise
vec2 distorted_uv_1 = UV + time_offset_1 + vec2(offset.x,offset.y * 1.75) * 0.1;
vec2 distorted_uv_2 = UV + time_offset_2 + vec2(offset.x,offset.y * 1.75) * 0.1;
vec4 final_noise_1 = texture(noise_texture_1, distorted_uv_1);
vec4 final_noise_2 = texture(noise_texture_2, distorted_uv_2);
float mixed_noise = mix(final_noise_1, final_noise_2, noise_blend).r;
float smoke_alpha = mixed_noise * density;
// Output color
COLOR = vec4(smoke_color, smoke_alpha);
}

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://do3wxh7k38m7u"
path="res://.godot/imported/seed_buried_texture.png-1822d7240070f3b15514c261d06c7402.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://entities/plants/assets/sprites/seed_buried_texture.png"
dest_files=["res://.godot/imported/seed_buried_texture.png-1822d7240070f3b15514c261d06c7402.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

@@ -2,6 +2,7 @@
[ext_resource type="Script" uid="uid://bmjjpk4lvijws" path="res://entities/plants/scripts/plant_sprite.gd" id="1_pq8o7"]
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="3_j6jm5"]
[ext_resource type="Texture2D" uid="uid://do3wxh7k38m7u" path="res://entities/plants/assets/sprites/seed_buried_texture.png" id="3_rbgiq"]
[sub_resource type="AtlasTexture" id="AtlasTexture_wyuub"]
atlas = ExtResource("3_j6jm5")
@@ -107,11 +108,17 @@ scale = Vector2(0.15, 0.15)
[node name="PlantedSeed" type="Sprite2D" parent="Sprite" unique_id=1134686525]
unique_name_in_owner = true
position = Vector2(0, 653.33325)
scale = Vector2(1.5, 1.5)
texture = SubResource("AtlasTexture_wyuub")
region_rect = Rect2(0, -50, 124, 135)
region_filter_clip_enabled = true
[node name="SeedBuriedTexture" type="Sprite2D" parent="Sprite/PlantedSeed" unique_id=2046939355]
position = Vector2(4.444448, 31.11118)
scale = Vector2(3.1777775, 3.1777775)
texture = ExtResource("3_rbgiq")
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1793068152]
unique_name_in_owner = true
libraries/ = SubResource("AnimationLibrary_8eofq")

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,14 @@
@tool
extends PlantTextureBuilderInstance
@export var hash : int = 0 :
set(v):
hash = v
update_seed_sprite()
func _ready():
update_seed_sprite()
func update_seed_sprite():
if is_node_ready():
%Sprite2D.texture = build_seed_texture(hash)

View File

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

View File

@@ -1,4 +1,5 @@
extends Node
class_name PlantTextureBuilderInstance
const IMAGE_WIDTH := 2048
const IMAGE_HEIGHT := 2048
@@ -75,23 +76,29 @@ func shuffle_weighted(array: Array, weights: Array[int]):
func build_seed_texture(random_seed: int) -> Texture:
rng.seed = random_seed
var texture_set: SeedTextureSet = pick_random(seed_texture_sets)
var seed_image := Image.create(SEED_TEXTURE_SIZE, SEED_TEXTURE_SIZE, false, Image.FORMAT_RGBA8)
for color_image in texture_set.color_images:
color_image.resize(SEED_TEXTURE_SIZE, SEED_TEXTURE_SIZE)
var texture_set : SeedTextureSet = pick_random(seed_texture_sets)
var seed_image := Image.create(SEED_TEXTURE_SIZE,SEED_TEXTURE_SIZE, false, Image.FORMAT_RGBA8)
for color_texture in texture_set.color_textures:
var color_image = color_texture.get_image().duplicate()
color_image.resize(SEED_TEXTURE_SIZE,SEED_TEXTURE_SIZE)
modulate_image(color_image, pick_random(COLOR_PALETTE))
seed_image.blend_rect(color_image, Rect2i(0, 0, SEED_TEXTURE_SIZE, SEED_TEXTURE_SIZE), Vector2i.ZERO)
if texture_set.outline_image:
var outline_image = texture_set.outline_image
outline_image.resize(SEED_TEXTURE_SIZE, SEED_TEXTURE_SIZE)
seed_image.blend_rect(outline_image, Rect2i(0, 0, SEED_TEXTURE_SIZE, SEED_TEXTURE_SIZE), Vector2i.ZERO)
seed_image.blend_rect(
color_image,
Rect2i(0,0,SEED_TEXTURE_SIZE,SEED_TEXTURE_SIZE),
Vector2i.ZERO
)
if texture_set.outline_texture:
var outline_image = texture_set.outline_texture.get_image().duplicate()
outline_image.resize(SEED_TEXTURE_SIZE,SEED_TEXTURE_SIZE)
seed_image.blend_rect(outline_image, Rect2i(0,0,SEED_TEXTURE_SIZE,SEED_TEXTURE_SIZE),Vector2i.ZERO)
if rng.randi() % 2 == 0:
if rng.randi()%2 == 0:
seed_image.flip_x()
return ImageTexture.create_from_image(image)
return ImageTexture.create_from_image(seed_image)
func build_plant_texture(plant_data: PlantData) -> Texture:
rng.seed = plant_data.random_seed

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://drgl0d51d4cf7"
path="res://.godot/imported/radial-gradient.png-f036338c44c4cdc3990cfae457a24205.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://entities/player/assets/sprites/radial-gradient.png"
dest_files=["res://.godot/imported/radial-gradient.png-f036338c44c4cdc3990cfae457a24205.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

@@ -59,6 +59,7 @@ func get_description() -> String:
return tr("PLANT_%s_MUST_BE_USED_IN_DECONTAMINATED_ZONE") % plant_name
func get_icon() -> Texture2D:
print("getting icon")
if stored_icon == null:
stored_icon = PlantTextureBuilder.build_seed_texture(plant_name.hash())
return stored_icon

View File

@@ -48,8 +48,9 @@ func use(player : Player, zone : Player.ActionZone) -> bool:
rock_layer.dig_rocks(zone.get_tiles())
var particles := (DIG_PARTICLES.instantiate() as Node2D)
var particles := (DIG_PARTICLES.instantiate() as DigParticleEmmitter)
player.region.add_child(particles)
particles.global_position = zone.get_global_position()
particles.emit()
return true

View File

@@ -20,6 +20,7 @@ unique_name_in_owner = true
amount = 10
lifetime = 1.0
speed_scale = 3.0
emission_sphere_radius = 60.0
spread = 50.0
gravity = Vector2(0, 400)
initial_velocity_min = 150.0

View File

@@ -1,6 +1,7 @@
extends Node2D
class_name DigParticleEmmitter
func _ready():
func emit():
%ExplosionParticles.emitting = true
%ExplosionParticles.finished.connect(
func (): queue_free()

View File

@@ -4,7 +4,8 @@
[ext_resource type="Texture2D" uid="uid://dompaj451gklw" path="res://entities/player/assets/sprites/movement_particles.png" id="2_bls4j"]
[ext_resource type="Texture2D" uid="uid://ys5fis3gsnoy" path="res://entities/player/assets/sprites/shadow.png" id="2_fkugw"]
[ext_resource type="Texture2D" uid="uid://c7ff87jniga5m" path="res://entities/player/assets/sprites/robot.png" id="4_bls4j"]
[ext_resource type="Script" path="res://entities/player/scripts/player_sprite.gd" id="5_fkugw"]
[ext_resource type="Texture2D" uid="uid://drgl0d51d4cf7" path="res://entities/player/assets/sprites/radial-gradient.png" id="5_8fjmc"]
[ext_resource type="Script" uid="uid://b1mmtgmi5oq86" path="res://entities/player/scripts/player_sprite.gd" id="5_fkugw"]
[sub_resource type="CircleShape2D" id="CircleShape2D_sglur"]
radius = 27.0
@@ -12,14 +13,6 @@ radius = 27.0
[sub_resource type="CircleShape2D" id="CircleShape2D_abrql"]
radius = 40.0
[sub_resource type="Curve" id="Curve_fkugw"]
_data = [Vector2(0, 0.14473677), 0.0, 0.0, 0, 0, Vector2(0.972549, 0.2654798), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="Gradient" id="Gradient_bls4j"]
offsets = PackedFloat32Array(0, 0.77729255, 1)
colors = PackedColorArray(0.5803922, 0.7058824, 0.8862745, 1, 0.5785, 0.70829165, 0.89, 1, 0.5785, 0.70829165, 0.89, 0)
[sub_resource type="AtlasTexture" id="AtlasTexture_fkugw"]
atlas = ExtResource("4_bls4j")
region = Rect2(3048, 0, 762, 1080)
@@ -119,6 +112,14 @@ animations = [{
"speed": 5.0
}]
[sub_resource type="Curve" id="Curve_fkugw"]
_data = [Vector2(0, 0.14473677), 0.0, 0.0, 0, 0, Vector2(0.972549, 0.2654798), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="Gradient" id="Gradient_bls4j"]
offsets = PackedFloat32Array(0, 0.77729255, 1)
colors = PackedColorArray(0.5803922, 0.7058824, 0.8862745, 1, 0.5785, 0.70829165, 0.89, 1, 0.5785, 0.70829165, 0.89, 0)
[sub_resource type="Animation" id="Animation_fkugw"]
length = 0.001
tracks/0/type = "value"
@@ -170,20 +171,11 @@ position = Vector2(0, -12)
[node name="CollisionShape2D" type="CollisionShape2D" parent="InteractArea2D" unique_id=1242017003]
shape = SubResource("CircleShape2D_abrql")
[node name="CPUParticles2D" type="CPUParticles2D" parent="InteractArea2D" unique_id=1489736082]
position = Vector2(-8.4703295e-22, 12)
scale = Vector2(0.22803418, 0.22803418)
amount = 3
texture = ExtResource("2_bls4j")
lifetime = 0.4
gravity = Vector2(0, 100)
scale_amount_curve = SubResource("Curve_fkugw")
color_ramp = SubResource("Gradient_bls4j")
[node name="Shadow" type="Sprite2D" parent="." unique_id=875064259]
modulate = Color(0, 0, 0, 0.41568628)
modulate = Color(0, 0, 0, 1)
z_index = -1
scale = Vector2(0.41025653, 0.41025642)
position = Vector2(-2.3841858e-07, -7.999996)
scale = Vector2(0.29154927, 0.29154924)
texture = ExtResource("2_fkugw")
[node name="PlayerSprite" type="AnimatedSprite2D" parent="." unique_id=638545037]
@@ -191,11 +183,29 @@ unique_name_in_owner = true
position = Vector2(0.99999994, -17)
scale = Vector2(0.0656168, 0.065616846)
sprite_frames = SubResource("SpriteFrames_a1qjk")
animation = &"right"
animation = &"front_left"
frame_progress = 0.15805355
offset = Vector2(0, -370)
script = ExtResource("5_fkugw")
wanted_orientation = 2
[node name="Light" type="Sprite2D" parent="PlayerSprite" unique_id=1768327734]
modulate = Color(0.70603025, 0.5959886, 0.33971557, 0.09019608)
z_index = -1
scale = Vector2(16.093441, 16.093441)
texture = ExtResource("5_8fjmc")
[node name="CPUParticles2D" type="CPUParticles2D" parent="PlayerSprite" unique_id=1489736082]
z_index = -1
position = Vector2(-15.239999, -60.95996)
scale = Vector2(3.4752407, 3.4752383)
amount = 3
texture = ExtResource("2_bls4j")
lifetime = 0.4
gravity = Vector2(0, 100)
scale_amount_curve = SubResource("Curve_fkugw")
color_ramp = SubResource("Gradient_bls4j")
[node name="FloatAnimationPlayer" type="AnimationPlayer" parent="." unique_id=793749564]
libraries/ = SubResource("AnimationLibrary_qiwj3")
autoplay = &"float"

213
gui/game/alert/alert.tscn Normal file
View File

@@ -0,0 +1,213 @@
[gd_scene format=3 uid="uid://edxmvtvtipwq"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_bmajk"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="2_jqcc2"]
[ext_resource type="Script" uid="uid://b8hth7y8sjfy4" path="res://gui/game/alert/scripts/alert.gd" id="2_tr7ge"]
[sub_resource type="Gradient" id="Gradient_id0t5"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.115169, 0.41573, 0.620786, 0.924157)
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_j7f85"]
gradient = SubResource("Gradient_id0t5")
fill_to = Vector2(1, 1)
repeat = 1
[sub_resource type="Animation" id="Animation_jqcc2"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("NoRechargeLeftBaneer:custom_minimum_size")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MarginContainer/Label: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)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_bmajk"]
resource_name = "appear"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.06666667),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MarginContainer/Label:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.06666667, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("NoRechargeLeftBaneer:custom_minimum_size")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.06666667, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(0, 0), Vector2(0, 50)]
}
[sub_resource type="Animation" id="Animation_tr7ge"]
resource_name = "hidden"
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("NoRechargeLeftBaneer:custom_minimum_size")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MarginContainer/Label: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)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_ekkvw"]
resource_name = "shown"
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("NoRechargeLeftBaneer:custom_minimum_size")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 50)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MarginContainer/Label: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, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_jqcc2"]
_data = {
&"RESET": SubResource("Animation_jqcc2"),
&"appear": SubResource("Animation_bmajk"),
&"hidden": SubResource("Animation_tr7ge"),
&"shown": SubResource("Animation_ekkvw")
}
[node name="Alert" type="VBoxContainer" unique_id=496897031]
visible = false
anchors_preset = 10
anchor_right = 1.0
grow_horizontal = 2
theme = ExtResource("1_bmajk")
theme_override_constants/separation = 0
script = ExtResource("2_tr7ge")
text = "Hello"
[node name="NoRechargeLeftBaneer" type="TextureRect" parent="." unique_id=23924313]
layout_mode = 2
texture = SubResource("GradientTexture2D_j7f85")
expand_mode = 1
stretch_mode = 1
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=813474581]
layout_mode = 2
[node name="Label" type="Label" parent="MarginContainer" unique_id=1564390461]
unique_name_in_owner = true
modulate = Color(1, 1, 1, 0)
layout_mode = 2
text = "Hello"
label_settings = ExtResource("2_jqcc2")
horizontal_alignment = 2
[node name="AppearAnimationPlayer" type="AnimationPlayer" parent="." unique_id=1593798240]
unique_name_in_owner = true
libraries/ = SubResource("AnimationLibrary_jqcc2")

View File

@@ -0,0 +1,25 @@
@tool
extends VBoxContainer
class_name Alert
@export var text = "" :
set(t):
text = t
if is_node_ready():
%Label.text = t
func appear(
with_anim : bool = not visible
):
if with_anim :
%AppearAnimationPlayer.play("appear")
else:
%AppearAnimationPlayer.play("shown")
func disappear(
with_anim : bool = visible
):
if with_anim :
%AppearAnimationPlayer.play_backwards("appear")
else:
%AppearAnimationPlayer.play("hidden")

View File

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

View File

@@ -2,6 +2,7 @@
[ext_resource type="Script" uid="uid://cqao7n800qy40" path="res://gui/game/scripts/game_gui.gd" id="1_udau0"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_nq5i2"]
[ext_resource type="PackedScene" uid="uid://edxmvtvtipwq" path="res://gui/game/alert/alert.tscn" id="2_ykapk"]
[ext_resource type="PackedScene" uid="uid://brfsapvj2quxm" path="res://gui/game/energy_info/energy_info.tscn" id="4_2wykm"]
[ext_resource type="PackedScene" uid="uid://fnv0qhkh40mv" path="res://gui/game/announce/announce.tscn" id="4_h6540"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="6_2wykm"]
@@ -11,116 +12,16 @@
[ext_resource type="Texture2D" uid="uid://b43thuq8piv18" path="res://common/icons/skull.svg" id="7_dr1y2"]
[ext_resource type="PackedScene" uid="uid://clicjf8ts51h8" path="res://gui/game/inventory_gui/inventory_gui.tscn" id="9_id0t5"]
[sub_resource type="Gradient" id="Gradient_id0t5"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.115169, 0.41573, 0.620786, 0.924157)
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_j7f85"]
gradient = SubResource("Gradient_id0t5")
fill_to = Vector2(1, 1)
repeat = 1
[sub_resource type="LabelSettings" id="LabelSettings_id0t5"]
font = ExtResource("6_2wykm")
font_size = 40
[sub_resource type="Animation" id="Animation_2wykm"]
resource_name = "NoRechargeAppear"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("MarginContainer/GiveUpButton:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.03333333),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MarginContainer/GiveUpButton:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("NoRechargeLeftBaneer:custom_minimum_size")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(0, 0), Vector2(0, 50)]
}
[sub_resource type="Animation" id="Animation_id0t5"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("MarginContainer/GiveUpButton:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MarginContainer/GiveUpButton: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, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("NoRechargeLeftBaneer:custom_minimum_size")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ykapk"]
_data = {
&"NoRechargeAppear": SubResource("Animation_2wykm"),
&"RESET": SubResource("Animation_id0t5")
}
[node name="GameGui" type="CanvasLayer" unique_id=274698556]
script = ExtResource("1_udau0")
[node name="NoRechargeLeftBaneer" type="TextureRect" parent="." unique_id=827897082]
self_modulate = Color(1, 0.6509804, 0.09019608, 1)
anchors_preset = 10
anchor_right = 1.0
grow_horizontal = 2
texture = SubResource("GradientTexture2D_j7f85")
expand_mode = 1
stretch_mode = 1
[node name="Alert" parent="." unique_id=496897031 instance=ExtResource("2_ykapk")]
unique_name_in_owner = true
modulate = Color(1, 0, 0.43137252, 1)
[node name="ScoreParticles" type="Control" parent="." unique_id=842190807]
unique_name_in_owner = true
@@ -192,13 +93,8 @@ size_flags_vertical = 8
[node name="GiveUpButton" type="Button" parent="MarginContainer" unique_id=1128310884]
unique_name_in_owner = true
visible = false
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 8
text = "GIVE_UP"
icon = ExtResource("7_dr1y2")
[node name="NoRechargeAnimationPlayer" type="AnimationPlayer" parent="." unique_id=969107428]
unique_name_in_owner = true
libraries/ = SubResource("AnimationLibrary_ykapk")

View File

@@ -20,6 +20,7 @@ func _ready():
%SimplePlantPointScore.visible = "tutorial" in GameInfo.game_data.current_region_data.flags
charge_update(GameInfo.game_data.current_region_data)
state_update(GameInfo.game_data.current_region_data)
player_update(GameInfo.game_data.player_data, false)
%EnergyInfo.reset_size()
%GiveUpButton.pressed.connect(_on_give_up_pressed)
@@ -59,6 +60,7 @@ func _on_region_updated(region_data : RegionData):
score_by_plant.erase(key)
charge_update(region_data)
state_update(region_data)
func _on_give_up_pressed():
GameInfo.game_data.give_up()
@@ -66,12 +68,6 @@ func _on_give_up_pressed():
func charge_update(region_data : RegionData):
%RechargesLeftLabel.text = tr("%d_CHARGE_LEFT") % (region_data.charges)
if region_data.charges == 0 and region_data.state != RegionData.State.SUCCEEDED:
if not %GiveUpButton.visible:
%NoRechargeAnimationPlayer.play("NoRechargeAppear")
else :
if %GiveUpButton.visible:
%NoRechargeAnimationPlayer.play_backward("NoRechargeAppear")
func score_update(with_animation = true):
var objective_progression : float
@@ -98,6 +94,23 @@ func score_update(with_animation = true):
else :
%SimplePlantPointScoreLabel.text = tr("%d_PLANT_POINT") % score_mirror
func state_update(region_data : RegionData):
if region_data.state == RegionData.State.SUCCEEDED:
print("C'est gagné !!")
%Alert.text = "SHIP_IS_READY_TO_TAKE_OFF"
if "tutorial" in region_data.flags:
%Alert.text = "TUTORIAL_FINISHED"
%Alert.modulate = Color("25C147")
%Alert.appear()
elif region_data.state == RegionData.State.FAILED:
%Alert.text = "NO_RECHARGE_LEFT"
%Alert.modulate = Color("FF006E")
%Alert.appear()
else:
%Alert.disappear()
print(region_data.state == RegionData.State.FAILED)
%GiveUpButton.visible = region_data.state == RegionData.State.FAILED
func plant_changing_score(plant_data: PlantData, amount : int):
if GameInfo.game_data.current_region_data.in_passing_day_animation:
await GameInfo.game_data.current_region_data.pass_day_ended

View File

@@ -107,9 +107,10 @@ func _process(_d):
func finish_tutorial():
GameInfo.game_data.tutorial_done = true
region.data.state = RegionData.State.SUCCEEDED
region.data.update()
succeded.emit()
class Step:
var text : String : get = get_text

View File

@@ -2,17 +2,114 @@
[ext_resource type="Script" uid="uid://d1mp5sguc0b6u" path="res://stages/terrain/region/scripts/region.gd" id="1_441sk"]
[ext_resource type="PackedScene" uid="uid://dt6mptqg80dew" path="res://gui/game/tutorial/tutorial.tscn" id="2_2f6js"]
[ext_resource type="Shader" uid="uid://cfj18vc04cgkg" path="res://common/vfx/materials/shaders/blur_vignette.gdshader" id="2_ktnx3"]
[ext_resource type="PackedScene" uid="uid://yk78ubpu5ghq" path="res://gui/game/pass_day/pass_day.tscn" id="3_ktnx3"]
[ext_resource type="Shader" uid="uid://btgk5l0a6ii44" path="res://common/vfx/materials/shaders/screen_fog.gdshader" id="3_qdnee"]
[ext_resource type="Script" uid="uid://bi8fo6yp25su7" path="res://stages/terrain/region/scripts/camera_fog.gd" id="4_ovqi1"]
[ext_resource type="PackedScene" uid="uid://12nak7amd1uq" path="res://gui/game/game_gui.tscn" id="4_qdnee"]
[ext_resource type="PackedScene" uid="uid://bgvbgeq46wee2" path="res://entities/player/player.tscn" id="5_ovqi1"]
[ext_resource type="PackedScene" uid="uid://d324mlmgls4fs" path="res://entities/interactables/truck/recharge/truck_recharge.tscn" id="7_6d8m3"]
[ext_resource type="PackedScene" uid="uid://b8m537op75gib" path="res://entities/interactables/door/door.tscn" id="8_2f6js"]
[ext_resource type="PackedScene" uid="uid://dj7gp3crtg2yt" path="res://entities/camera/camera.tscn" id="8_fwgig"]
[ext_resource type="Texture2D" uid="uid://rdrhi3r11ey6" path="res://common/icons/square-rounded.svg" id="10_ktnx3"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qdnee"]
shader = ExtResource("2_ktnx3")
shader_parameter/blur_radius = 0.0630000029925
shader_parameter/blur_amount = 1.0000000475
shader_parameter/blur_inner = 0.4950000235125
shader_parameter/blur_outer = 0.7810000370975
[sub_resource type="FastNoiseLite" id="FastNoiseLite_ovqi1"]
noise_type = 2
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_2w03p"]
noise = SubResource("FastNoiseLite_ovqi1")
seamless = true
[sub_resource type="FastNoiseLite" id="FastNoiseLite_6d8m3"]
noise_type = 2
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_fwgig"]
noise = SubResource("FastNoiseLite_6d8m3")
seamless = true
[sub_resource type="ShaderMaterial" id="ShaderMaterial_mlppq"]
shader = ExtResource("3_qdnee")
shader_parameter/camera_position = Vector2(0, 0)
shader_parameter/camera_offset = Vector2(0, 0)
shader_parameter/camera_position_speed = 0.010000000475
shader_parameter/camera_offset_speed = 0.0
shader_parameter/noise_texture_1 = SubResource("NoiseTexture2D_2w03p")
shader_parameter/noise_texture_2 = SubResource("NoiseTexture2D_fwgig")
shader_parameter/noise_blend = 0.50000002375
shader_parameter/noise_speed_1 = 0.10000000475
shader_parameter/noise_speed_2 = 0.010000000475
shader_parameter/noise_dir_1 = Vector2(1, 1)
shader_parameter/noise_dir_2 = Vector2(1, -1)
shader_parameter/smoke_color = Color(1, 1, 1, 1)
shader_parameter/density = 0.010000000475
[sub_resource type="Curve" id="Curve_qdnee"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.4883721, 1), 0.037164874, 0.037164874, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_ovqi1"]
curve = SubResource("Curve_qdnee")
[sub_resource type="Curve" id="Curve_2w03p"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="Curve" id="Curve_6d8m3"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.25581396, 1), 0.0, 0.0, 0, 0, Vector2(0.5023256, 0), 0.0, 0.0, 0, 0, Vector2(0.75348836, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 5
[sub_resource type="CurveXYZTexture" id="CurveXYZTexture_fwgig"]
curve_x = SubResource("Curve_2w03p")
curve_y = SubResource("Curve_6d8m3")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_mlppq"]
emission_shape = 3
emission_box_extents = Vector3(1000, 1000, 1)
spread = 10.0
initial_velocity_min = 100.0
initial_velocity_max = 200.0
directional_velocity_min = -100.000015
directional_velocity_max = 99.999985
directional_velocity_curve = SubResource("CurveXYZTexture_fwgig")
gravity = Vector3(0, 0, 0)
scale_min = 0.049999997
scale_max = 0.099999994
color = Color(0.9, 0.92, 1, 0.4392157)
alpha_curve = SubResource("CurveTexture_ovqi1")
[node name="Region" type="Node2D" unique_id=1509166288 node_paths=PackedStringArray("entity_container")]
script = ExtResource("1_441sk")
entity_container = NodePath("Entities")
[node name="PostProcess" type="CanvasLayer" parent="." unique_id=729471745]
[node name="Vignette" type="ColorRect" parent="PostProcess" unique_id=2057271511]
material = SubResource("ShaderMaterial_qdnee")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="Fog" type="ColorRect" parent="PostProcess" unique_id=1487713892 node_paths=PackedStringArray("camera")]
material = SubResource("ShaderMaterial_mlppq")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("4_ovqi1")
camera = NodePath("../../Camera")
[node name="PassDay" parent="." unique_id=1144772570 instance=ExtResource("3_ktnx3")]
unique_name_in_owner = true
@@ -65,3 +162,21 @@ default_info_desc = "MYSTERIOUS_DOOR_TEXT"
[node name="Camera" parent="." unique_id=1399042986 node_paths=PackedStringArray("following") instance=ExtResource("8_fwgig")]
following = NodePath("../Entities/Player")
[node name="WindParticles" type="GPUParticles2D" parent="Camera" unique_id=1897174931]
position = Vector2(2, 7)
texture = ExtResource("10_ktnx3")
lifetime = 8.0
trail_enabled = true
trail_lifetime = 0.09999999999999999
trail_sections = 16
process_material = SubResource("ParticleProcessMaterial_mlppq")
[node name="Fog" type="GPUParticles2D" parent="Camera" unique_id=1024566195]
position = Vector2(2, 7)
texture = ExtResource("10_ktnx3")
lifetime = 8.0
trail_enabled = true
trail_lifetime = 0.09999999999999999
trail_sections = 16
process_material = SubResource("ParticleProcessMaterial_mlppq")

View File

@@ -0,0 +1,10 @@
extends ColorRect
@export var camera : Camera
func _process(_delta: float) -> void:
if is_node_ready():
if visible:
if camera:
material.set_shader_parameter( "camera_position", camera.global_position )
# material.set_shader_parameter( "camera_offset", camera.offset )

View File

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

View File

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

View File

@@ -30,9 +30,7 @@ const MAX_RANDOM_SPAWN_DISTANCE = 3000
@export var flags : Array[String] = []
@export var plants : Array[PlantData]
@export var state : State = State.IN_PROGRESS :
set(v):
state = v
@export var state : State = State.IN_PROGRESS
@export var chunks_data : Dictionary[String, ChunkData]
@@ -70,7 +68,7 @@ func _init(
player_position = player_spawn
func update():
if objective > 0 and get_score() >= objective:
if objective > 0 and get_score() >= objective and not "tutorial" in flags:
if state != State.SUCCEEDED:
succeded.emit()
state = State.SUCCEEDED

View File

@@ -188,6 +188,9 @@ LOCATION,Location,Location
LAND_SHIP,Land Ship,Atterrir
TAKE_OFF,Take Off,Décoller
NO_MORE_ENERGY,No more energy,Plus assez d'énergie
NO_RECHARGE_LEFT,No recharge left,Pas de recharge restante
SHIP_IS_READY_TO_TAKE_OFF,Ship is ready to take off,Le vaisseau est prêt à partir
TUTORIAL_FINISHED,Tutorial finished,Tutoriel terminé
CHOOSE_DESTINATION,Choose destination,Choisissez la destination
THANKS_FOR_PLAYING,Thanks for playing to the demo!,Merci davoir joué à la démo !
JOIN_OUR_INSTAGRAM,Join our Instagram,Rejoins-nous sur Instagram
1 keys en fr
188 WRITING_DEV_AND_GAME_DESIGN ART Writing, Development and Game Design Art Écriture, Développement et Game Design Art
189 MUSIC_SOUND_DESIGN_AND_WRITING ART_GAME_JAM Music, Sound design and Wrinting Art (Game Jam) Musique, Sons et Écriture Art (Game Jam)
190 COMMUNICATION DEV_AND_GAME_DESIGN Communication Development and Game Design Communication Développement et Game Design
191 WRITING_DEV_AND_GAME_DESIGN Writing, Development and Game Design Écriture, Développement et Game Design
192 MUSIC_SOUND_DESIGN_AND_WRITING Music, Sound design and Wrinting Musique, Sons et Écriture
193 COMMUNICATION Communication Communication
194 SPLASH_ART Splash Art Splash Art
195 TRAILER Trailer Trailer
196 CREDITS Credits Crédits