diff --git a/godot/scenes/faces/fac4C4.tmp b/godot/scenes/faces/fac4C4.tmp new file mode 100644 index 0000000..8d1d7d8 --- /dev/null +++ b/godot/scenes/faces/fac4C4.tmp @@ -0,0 +1,24 @@ +[gd_scene load_steps=5 format=3 uid="uid://bvc6fbd5cgb0i"] + +[ext_resource type="Texture2D" uid="uid://f74hle6gaeie" path="res://sprites/faces/curly_happy.png" id="1_7pet0"] +[ext_resource type="Script" path="res://scenes/faces/face.gd" id="1_vcbhp"] +[ext_resource type="Texture2D" uid="uid://oeljmd05bkvj" path="res://sprites/faces/curly_neutral.png" id="2_54uqk"] +[ext_resource type="Texture2D" uid="uid://5iygla17stpm" path="res://sprites/faces/curly_not_amused.png" id="3_2t0h4"] + +[node name="FaceCurly" type="Node2D" node_paths=PackedStringArray("sprite_happy", "sprite_neutral", "sprite_unhappy")] +script = ExtResource("1_vcbhp") +mood = 1 +sprite_happy = NodePath("Happy") +sprite_neutral = NodePath("Neutral") +sprite_unhappy = NodePath("Unhappy") + +[node name="Happy" type="Sprite2D" parent="."] +modulate = Color(1, 1, 1, 0) +texture = ExtResource("1_7pet0") + +[node name="Neutral" type="Sprite2D" parent="."] +texture = ExtResource("2_54uqk") + +[node name="Unhappy" type="Sprite2D" parent="."] +modulate = Color(1, 1, 1, 0) +texture = ExtResource("3_2t0h4") diff --git a/godot/scenes/faces/facE815.tmp b/godot/scenes/faces/facE815.tmp new file mode 100644 index 0000000..8d1d7d8 --- /dev/null +++ b/godot/scenes/faces/facE815.tmp @@ -0,0 +1,24 @@ +[gd_scene load_steps=5 format=3 uid="uid://bvc6fbd5cgb0i"] + +[ext_resource type="Texture2D" uid="uid://f74hle6gaeie" path="res://sprites/faces/curly_happy.png" id="1_7pet0"] +[ext_resource type="Script" path="res://scenes/faces/face.gd" id="1_vcbhp"] +[ext_resource type="Texture2D" uid="uid://oeljmd05bkvj" path="res://sprites/faces/curly_neutral.png" id="2_54uqk"] +[ext_resource type="Texture2D" uid="uid://5iygla17stpm" path="res://sprites/faces/curly_not_amused.png" id="3_2t0h4"] + +[node name="FaceCurly" type="Node2D" node_paths=PackedStringArray("sprite_happy", "sprite_neutral", "sprite_unhappy")] +script = ExtResource("1_vcbhp") +mood = 1 +sprite_happy = NodePath("Happy") +sprite_neutral = NodePath("Neutral") +sprite_unhappy = NodePath("Unhappy") + +[node name="Happy" type="Sprite2D" parent="."] +modulate = Color(1, 1, 1, 0) +texture = ExtResource("1_7pet0") + +[node name="Neutral" type="Sprite2D" parent="."] +texture = ExtResource("2_54uqk") + +[node name="Unhappy" type="Sprite2D" parent="."] +modulate = Color(1, 1, 1, 0) +texture = ExtResource("3_2t0h4") diff --git a/godot/scenes/faces/face.gd b/godot/scenes/faces/face.gd new file mode 100644 index 0000000..a934d0f --- /dev/null +++ b/godot/scenes/faces/face.gd @@ -0,0 +1,38 @@ +extends Node2D + +@export var mood : int = 0 +var last_mood : int = 0 + +@export var sprite_happy : Sprite2D +@export var sprite_neutral : Sprite2D +@export var sprite_unhappy : Sprite2D + +const tween_speed : float = 1.5 +const color_transparent : Color = Color(1, 1, 1, 0) +const color_visible : Color = Color(1, 1, 1, 1) + +# Called when the node enters the scene tree for the first time. +func _ready(): + mood = 0 + last_mood = 0 + sprite_happy.modulate.a = 0 + sprite_neutral.modulate.a = 1 + sprite_unhappy.modulate.a = 0 + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(_delta): + if mood != last_mood: + var tween = get_tree().create_tween().bind_node(self).set_parallel().set_trans(Tween.TRANS_LINEAR) + if mood < 0: + tween.tween_property(sprite_unhappy, "modulate", color_visible, tween_speed) + tween.tween_property(sprite_neutral, "modulate", color_transparent, tween_speed) + tween.tween_property(sprite_happy, "modulate", color_transparent, tween_speed) + elif mood > 0: + tween.tween_property(sprite_unhappy, "modulate", color_transparent, tween_speed) + tween.tween_property(sprite_neutral, "modulate", color_transparent, tween_speed) + tween.tween_property(sprite_happy, "modulate", color_visible, tween_speed) + else: + tween.tween_property(sprite_unhappy, "modulate", color_transparent, tween_speed) + tween.tween_property(sprite_neutral, "modulate", color_visible, tween_speed) + tween.tween_property(sprite_happy, "modulate", color_transparent, tween_speed) + last_mood = mood diff --git a/godot/scenes/faces/face_curly.tscn b/godot/scenes/faces/face_curly.tscn new file mode 100644 index 0000000..f0866f3 --- /dev/null +++ b/godot/scenes/faces/face_curly.tscn @@ -0,0 +1,23 @@ +[gd_scene load_steps=5 format=3 uid="uid://bvc6fbd5cgb0i"] + +[ext_resource type="Texture2D" uid="uid://f74hle6gaeie" path="res://sprites/faces/curly_happy.png" id="1_7pet0"] +[ext_resource type="Script" path="res://scenes/faces/face.gd" id="1_vcbhp"] +[ext_resource type="Texture2D" uid="uid://oeljmd05bkvj" path="res://sprites/faces/curly_neutral.png" id="2_54uqk"] +[ext_resource type="Texture2D" uid="uid://5iygla17stpm" path="res://sprites/faces/curly_not_amused.png" id="3_2t0h4"] + +[node name="FaceCurly" type="Node2D" node_paths=PackedStringArray("sprite_happy", "sprite_neutral", "sprite_unhappy")] +script = ExtResource("1_vcbhp") +sprite_happy = NodePath("Happy") +sprite_neutral = NodePath("Neutral") +sprite_unhappy = NodePath("Unhappy") + +[node name="Happy" type="Sprite2D" parent="."] +modulate = Color(1, 1, 1, 0) +texture = ExtResource("1_7pet0") + +[node name="Neutral" type="Sprite2D" parent="."] +texture = ExtResource("2_54uqk") + +[node name="Unhappy" type="Sprite2D" parent="."] +modulate = Color(1, 1, 1, 0) +texture = ExtResource("3_2t0h4") diff --git a/godot/sprites/faces/curly_happy.png b/godot/sprites/faces/curly_happy.png new file mode 100644 index 0000000..3ae996e Binary files /dev/null and b/godot/sprites/faces/curly_happy.png differ diff --git a/godot/sprites/faces/curly_happy.png.import b/godot/sprites/faces/curly_happy.png.import new file mode 100644 index 0000000..0234d6a --- /dev/null +++ b/godot/sprites/faces/curly_happy.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://f74hle6gaeie" +path="res://.godot/imported/curly_happy.png-9e9ff70650ad5d974bed4d467c2fab96.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/faces/curly_happy.png" +dest_files=["res://.godot/imported/curly_happy.png-9e9ff70650ad5d974bed4d467c2fab96.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/godot/sprites/faces/curly_neutral.png b/godot/sprites/faces/curly_neutral.png new file mode 100644 index 0000000..d8537c1 Binary files /dev/null and b/godot/sprites/faces/curly_neutral.png differ diff --git a/godot/sprites/faces/curly_neutral.png.import b/godot/sprites/faces/curly_neutral.png.import new file mode 100644 index 0000000..18ae2b6 --- /dev/null +++ b/godot/sprites/faces/curly_neutral.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://oeljmd05bkvj" +path="res://.godot/imported/curly_neutral.png-744de6cc3b034dab87651d1b8bea41fc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/faces/curly_neutral.png" +dest_files=["res://.godot/imported/curly_neutral.png-744de6cc3b034dab87651d1b8bea41fc.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/godot/sprites/faces/curly_not_amused.png b/godot/sprites/faces/curly_not_amused.png new file mode 100644 index 0000000..068b27d Binary files /dev/null and b/godot/sprites/faces/curly_not_amused.png differ diff --git a/godot/sprites/faces/curly_not_amused.png.import b/godot/sprites/faces/curly_not_amused.png.import new file mode 100644 index 0000000..e729907 --- /dev/null +++ b/godot/sprites/faces/curly_not_amused.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://5iygla17stpm" +path="res://.godot/imported/curly_not_amused.png-498d9cc5b1b6d3ab361a6266096d6b59.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/faces/curly_not_amused.png" +dest_files=["res://.godot/imported/curly_not_amused.png-498d9cc5b1b6d3ab361a6266096d6b59.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