Version 2 : front/back FX differenciated by having 2 different FX separated : halo and stars
This commit is contained in:
@@ -29,6 +29,7 @@ var blink_random: int = 3
|
||||
@onready var button: Button = $Button
|
||||
@onready var highlight_fx: HighlightFX = %HighlightFX
|
||||
@onready var right_fx: RightFX = %RightFX
|
||||
@onready var right_stars: RightStarsFX = %Right_Stars
|
||||
@onready var wrong_fx: WrongFX = %WrongFX
|
||||
@onready var audio_stream_player: AudioStreamPlayer = $AudioStreamPlayer
|
||||
@onready var text_outline: Sprite2D = %TextBox_Outline_Sprite2D
|
||||
@@ -75,6 +76,7 @@ func right() -> void:
|
||||
text_outline.show()
|
||||
animated_sprite.play("right")
|
||||
right_fx.play()
|
||||
right_stars.play()
|
||||
await right_fx.finished
|
||||
|
||||
|
||||
|
||||
@@ -68,19 +68,6 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
scale = Vector2(0.6, 0.6)
|
||||
|
||||
[node name="WrongFX" parent="BackFX" instance=ExtResource("5_3sw4w")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
|
||||
[node name="Body" type="Control" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
@@ -152,6 +139,19 @@ anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="WrongFX" parent="FrontFX" instance=ExtResource("5_3sw4w")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
|
||||
@@ -54,6 +54,7 @@ var stimulus: Dictionary = {}:
|
||||
@onready var label: Label = %AutoSizeLabel.get_node("Label")
|
||||
@onready var highlight_fx: HighlightFX = %HighlightFX
|
||||
@onready var right_fx: RightFX = %RightFX
|
||||
@onready var right_stars: RightStarsFX = %Right_Stars
|
||||
@onready var wrong_fx: WrongFX = %WrongFX
|
||||
@onready var text_box_sprite_2d: Sprite2D = %TextBox_Sprite2D
|
||||
@onready var text_box_outline_sprite_2d: Sprite2D = %TextBox_Outline_Sprite2D
|
||||
@@ -106,6 +107,7 @@ func right() -> void:
|
||||
text_box_outline_sprite_2d.self_modulate = Color("#009344")
|
||||
text_box_outline_sprite_2d.show()
|
||||
right_fx.play()
|
||||
right_stars.play()
|
||||
await right_fx.finished
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://cpkwyypyikpfc"]
|
||||
[gd_scene load_steps=14 format=3 uid="uid://cpkwyypyikpfc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bk5oyj8r6aw2h" path="res://sources/utils/sprite_control.gd" id="1_1b85n"]
|
||||
[ext_resource type="Script" uid="uid://b1lfi4hen3e7" path="res://sources/minigames/jellyfish/jellyfish.gd" id="1_06uwq"]
|
||||
@@ -12,6 +12,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://dlmbxcgiv8tpr" path="res://sources/utils/fx/wrong.tscn" id="6_w1tlu"]
|
||||
[ext_resource type="LabelSettings" uid="uid://bguqnhiblwick" path="res://resources/themes/minigames_label_settings.tres" id="9_ah5ir"]
|
||||
[ext_resource type="Texture2D" uid="uid://bbtr0cyiapi3g" path="res://assets/minigames/minigame_ui/graphic/primary_text_box_outline.png" id="10_jfr88"]
|
||||
[ext_resource type="PackedScene" uid="uid://br6yhq4w7b420" path="res://sources/utils/fx/right_stars.tscn" id="13_jfr88"]
|
||||
|
||||
[node name="Jellyfish" type="Control"]
|
||||
custom_minimum_size = Vector2(400, 400)
|
||||
@@ -19,7 +20,7 @@ layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 400.0
|
||||
offset_bottom = 400.0
|
||||
scale = Vector2(1.0692327, 1.0692327)
|
||||
scale = Vector2(1.0191087, 1.0191087)
|
||||
script = ExtResource("1_06uwq")
|
||||
|
||||
[node name="BackFX" type="Control" parent="."]
|
||||
@@ -84,13 +85,13 @@ unique_name_in_owner = true
|
||||
scale = Vector2(0.5, 0.5)
|
||||
sprite_frames = ExtResource("6_p6hdi")
|
||||
animation = &"idle"
|
||||
frame_progress = 0.1467905
|
||||
frame_progress = 0.058146853
|
||||
centered = false
|
||||
offset = Vector2(-0.000205994, 0.00019455)
|
||||
|
||||
[node name="TextBox_Sprite2D" type="Sprite2D" parent="SpriteControl"]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(200.421, 242.545)
|
||||
position = Vector2(200, 242)
|
||||
scale = Vector2(0.471, 0.471)
|
||||
texture = ExtResource("6_ah5ir")
|
||||
|
||||
@@ -132,7 +133,7 @@ unique_name_in_owner = true
|
||||
scale = Vector2(0.5, 0.5)
|
||||
sprite_frames = ExtResource("6_i86t4")
|
||||
animation = &"idle"
|
||||
frame_progress = 0.1467905
|
||||
frame_progress = 0.058146853
|
||||
centered = false
|
||||
offset = Vector2(-0.000205994, 0.00019455)
|
||||
|
||||
@@ -145,6 +146,10 @@ size_flags_vertical = 0
|
||||
mouse_filter = 1
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="Right_Stars" parent="FrontFX" instance=ExtResource("13_jfr88")]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(200, 242)
|
||||
|
||||
[connection signal="gui_input" from="." to="." method="_on_gui_input"]
|
||||
|
||||
[editable path="SpriteControl/TextBox_Sprite2D/PercentMarginContainer/AspectRatioContainer/AutoSizeLabel"]
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://cn2rw06pltyiu"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://cn2rw06pltyiu"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://djqbam0o37ayq" path="res://sources/utils/fx/right.gd" id="1_83pnv"]
|
||||
[ext_resource type="AudioStream" uid="uid://s0cxaexjq5l2" path="res://assets/sfx/sfx_right.mp3" id="2_ebh1q"]
|
||||
[ext_resource type="Texture2D" uid="uid://cbjnvgc5jkpj8" path="res://assets/vfx/halo.png" id="4_5o5es"]
|
||||
[ext_resource type="Texture2D" uid="uid://ckmh0rn7e8mq" path="res://assets/vfx/star.png" id="4_uanlr"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_sc4ca"]
|
||||
length = 0.001
|
||||
@@ -43,7 +42,7 @@ tracks/2/keys = {
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("GPUParticles2D:emitting")
|
||||
tracks/3/path = NodePath("AudioStreamPlayer2D:playing")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
@@ -52,18 +51,6 @@ tracks/3/keys = {
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("AudioStreamPlayer2D:playing")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_xu0xr"]
|
||||
resource_name = "right"
|
||||
@@ -103,7 +90,7 @@ tracks/2/keys = {
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("GPUParticles2D:emitting")
|
||||
tracks/3/path = NodePath("AudioStreamPlayer2D:playing")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
@@ -112,18 +99,6 @@ tracks/3/keys = {
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("AudioStreamPlayer2D:playing")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_k8dqy"]
|
||||
_data = {
|
||||
@@ -131,37 +106,6 @@ _data = {
|
||||
&"right": SubResource("Animation_xu0xr")
|
||||
}
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_u3fxj"]
|
||||
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_c2dvd"]
|
||||
gradient = SubResource("Gradient_u3fxj")
|
||||
width = 32
|
||||
|
||||
[sub_resource type="Curve" id="Curve_4x1t7"]
|
||||
_limits = [0.0, 0.8, 0.0, 1.0]
|
||||
_data = [Vector2(0, 0.8), 0.0, 0.0, 0, 0, Vector2(1, 0), -2.08937, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_m4jha"]
|
||||
width = 32
|
||||
curve = SubResource("Curve_4x1t7")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_dwcrn"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(100, 50, 1)
|
||||
direction = Vector3(0, -1, 0)
|
||||
initial_velocity_min = 100.0
|
||||
initial_velocity_max = 200.0
|
||||
angular_velocity_min = -100.000015
|
||||
angular_velocity_max = 49.99998
|
||||
gravity = Vector3(0, 98, 0)
|
||||
scale_min = 0.08
|
||||
scale_max = 0.12
|
||||
scale_curve = SubResource("CurveTexture_m4jha")
|
||||
color_ramp = SubResource("GradientTexture1D_c2dvd")
|
||||
|
||||
[node name="RightFX" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
@@ -182,13 +126,4 @@ self_modulate = Color(1, 0.827451, 0.4, 1)
|
||||
scale = Vector2(0.8, 0.8)
|
||||
texture = ExtResource("4_5o5es")
|
||||
|
||||
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
|
||||
self_modulate = Color(1, 0.827451, 0.4, 1)
|
||||
emitting = false
|
||||
texture = ExtResource("4_uanlr")
|
||||
lifetime = 2.5
|
||||
one_shot = true
|
||||
explosiveness = 1.0
|
||||
process_material = SubResource("ParticleProcessMaterial_dwcrn")
|
||||
|
||||
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_player_animation_finished"]
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
class_name RightStarsFX
|
||||
extends Node2D
|
||||
|
||||
|
||||
@onready var gpu_particles_2d: GPUParticles2D = $GPUParticles2D
|
||||
|
||||
func play() -> void:
|
||||
gpu_particles_2d.set_emitting(true)
|
||||
@@ -0,0 +1 @@
|
||||
uid://fduykuptafux
|
||||
@@ -0,0 +1,47 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://br6yhq4w7b420"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://fduykuptafux" path="res://sources/utils/fx/right_stars.gd" id="1_kulwr"]
|
||||
[ext_resource type="Texture2D" uid="uid://ckmh0rn7e8mq" path="res://assets/vfx/star.png" id="1_r3bwq"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_u3fxj"]
|
||||
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_c2dvd"]
|
||||
gradient = SubResource("Gradient_u3fxj")
|
||||
width = 32
|
||||
|
||||
[sub_resource type="Curve" id="Curve_4x1t7"]
|
||||
_limits = [0.0, 0.8, 0.0, 1.0]
|
||||
_data = [Vector2(0, 0.8), 0.0, 0.0, 0, 0, Vector2(1, 0), -2.08937, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_m4jha"]
|
||||
width = 32
|
||||
curve = SubResource("Curve_4x1t7")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_dwcrn"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(100, 50, 1)
|
||||
direction = Vector3(0, -1, 0)
|
||||
initial_velocity_min = 100.0
|
||||
initial_velocity_max = 200.0
|
||||
angular_velocity_min = -100.000015
|
||||
angular_velocity_max = 49.99998
|
||||
gravity = Vector3(0, 98, 0)
|
||||
scale_min = 0.08
|
||||
scale_max = 0.12
|
||||
scale_curve = SubResource("CurveTexture_m4jha")
|
||||
color_ramp = SubResource("GradientTexture1D_c2dvd")
|
||||
|
||||
[node name="Right_Stars" type="Node2D"]
|
||||
script = ExtResource("1_kulwr")
|
||||
|
||||
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
|
||||
self_modulate = Color(1, 0.827451, 0.4, 1)
|
||||
emitting = false
|
||||
texture = ExtResource("1_r3bwq")
|
||||
lifetime = 2.5
|
||||
one_shot = true
|
||||
explosiveness = 1.0
|
||||
process_material = SubResource("ParticleProcessMaterial_dwcrn")
|
||||
Reference in New Issue
Block a user