added emotion

This commit is contained in:
pennyrigate 2025-08-16 23:18:26 -04:00
parent bb702a88f0
commit 807cfb4b57
19 changed files with 340 additions and 14 deletions

View file

@ -37,7 +37,11 @@ func _physics_process(delta: float) -> void:
%AnimationPlayer.play("touch")
#Look
if %RayCast3D.is_colliding():
print(%RayCast3D.get_collider())
var collider = %RayCast3D.get_collider()
if collider.is_in_group("emotional"):
Hud.face.play(str(collider.get_parent().emotion))
else:
Hud.face.play("neutral")
if mouse_captured: _handle_joypad_camera_rotation(delta)
velocity = _walk(delta) + _gravity(delta) + _jump(delta)

View file

@ -96,7 +96,9 @@ surface_material_override/0 = SubResource("StandardMaterial3D_k53q1")
[node name="RayCast3D" type="RayCast3D" parent="Camera"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, -0.0119028, -0.999929, 0, 0.999929, -0.0119028, 0, -0.33609, 0)
target_position = Vector3(0, -5, 0)
target_position = Vector3(0, -7, 0)
collide_with_areas = true
collide_with_bodies = false
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://fjgddkynnder"
path="res://.godot/imported/face_happy.png-4139ba8b4d693a247d795cbbfdf683a0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/ui/face_happy.png"
dest_files=["res://.godot/imported/face_happy.png-4139ba8b4d693a247d795cbbfdf683a0.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cf4jyuwvoyu43"
path="res://.godot/imported/face_mad.png-19b50fd914baa0b288f50baa42073f24.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/ui/face_mad.png"
dest_files=["res://.godot/imported/face_mad.png-19b50fd914baa0b288f50baa42073f24.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bbcsjswtsq5vg"
path="res://.godot/imported/face_neutral.png-c76373830ea9ebe5d6bdbfc1696ff710.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/ui/face_neutral.png"
dest_files=["res://.godot/imported/face_neutral.png-c76373830ea9ebe5d6bdbfc1696ff710.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dla7tr4klmbim"
path="res://.godot/imported/smiley_happy.png-e27a7d96cffeb6588076148a53e184bc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/ui/smiley_happy.png"
dest_files=["res://.godot/imported/smiley_happy.png-e27a7d96cffeb6588076148a53e184bc.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bhkamm3nrfimg"
path="res://.godot/imported/smiley_mad.png-237d58d97e111b6cbc02d141ae686fef.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/ui/smiley_mad.png"
dest_files=["res://.godot/imported/smiley_mad.png-237d58d97e111b6cbc02d141ae686fef.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

3
emotional_object.gd Normal file
View file

@ -0,0 +1,3 @@
extends MeshInstance3D
@export var emotion = "neutral"

1
emotional_object.gd.uid Normal file
View file

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

File diff suppressed because one or more lines are too long

View file

@ -15,6 +15,10 @@ run/main_scene="uid://cxllykh18amy3"
config/features=PackedStringArray("4.4", "Forward Plus")
config/icon="res://icon.svg"
[autoload]
Hud="*res://ui/hud.tscn"
[display]
window/size/viewport_width=480
@ -54,3 +58,7 @@ touch={
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(129, 17),"global_position":Vector2(138, 65),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
]
}
[rendering]
textures/canvas_textures/default_texture_filter=0

3
ui/hud.gd Normal file
View file

@ -0,0 +1,3 @@
extends Control
@onready var face = %Face

1
ui/hud.gd.uid Normal file
View file

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

108
ui/hud.tscn Normal file
View file

@ -0,0 +1,108 @@
[gd_scene load_steps=16 format=3 uid="uid://bnmtddab1b33d"]
[ext_resource type="Script" uid="uid://utw0yjt02c0v" path="res://ui/hud.gd" id="1_7ihmi"]
[ext_resource type="Texture2D" uid="uid://evvl4jklinky" path="res://assets/graphics/ui/smileyface.png" id="1_rbyyf"]
[ext_resource type="Texture2D" uid="uid://fjgddkynnder" path="res://assets/graphics/ui/face_happy.png" id="3_1v5rv"]
[ext_resource type="Texture2D" uid="uid://cf4jyuwvoyu43" path="res://assets/graphics/ui/face_mad.png" id="3_en2x2"]
[ext_resource type="Texture2D" uid="uid://bbcsjswtsq5vg" path="res://assets/graphics/ui/face_neutral.png" id="5_q43x7"]
[sub_resource type="AtlasTexture" id="AtlasTexture_spcu4"]
atlas = ExtResource("3_1v5rv")
region = Rect2(0, 0, 100, 100)
[sub_resource type="AtlasTexture" id="AtlasTexture_ff8ar"]
atlas = ExtResource("3_1v5rv")
region = Rect2(100, 0, 100, 100)
[sub_resource type="AtlasTexture" id="AtlasTexture_m0eg6"]
atlas = ExtResource("3_1v5rv")
region = Rect2(200, 0, 100, 100)
[sub_resource type="AtlasTexture" id="AtlasTexture_1v5rv"]
atlas = ExtResource("3_en2x2")
region = Rect2(0, 0, 100, 100)
[sub_resource type="AtlasTexture" id="AtlasTexture_q43x7"]
atlas = ExtResource("3_en2x2")
region = Rect2(100, 0, 100, 100)
[sub_resource type="AtlasTexture" id="AtlasTexture_srpbi"]
atlas = ExtResource("3_en2x2")
region = Rect2(200, 0, 100, 100)
[sub_resource type="AtlasTexture" id="AtlasTexture_b00kl"]
atlas = ExtResource("5_q43x7")
region = Rect2(0, 0, 100, 100)
[sub_resource type="AtlasTexture" id="AtlasTexture_so1yu"]
atlas = ExtResource("5_q43x7")
region = Rect2(100, 0, 100, 100)
[sub_resource type="AtlasTexture" id="AtlasTexture_65xic"]
atlas = ExtResource("5_q43x7")
region = Rect2(200, 0, 100, 100)
[sub_resource type="SpriteFrames" id="SpriteFrames_en2x2"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_spcu4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ff8ar")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_m0eg6")
}],
"loop": true,
"name": &"happy",
"speed": 10.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_1v5rv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_q43x7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_srpbi")
}],
"loop": true,
"name": &"mad",
"speed": 10.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_b00kl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_so1yu")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_65xic")
}],
"loop": true,
"name": &"neutral",
"speed": 10.0
}]
[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("1_7ihmi")
[node name="Smileyface" type="Sprite2D" parent="."]
visible = false
position = Vector2(53, 50)
texture = ExtResource("1_rbyyf")
[node name="Face" type="AnimatedSprite2D" parent="."]
unique_name_in_owner = true
position = Vector2(50, 50)
sprite_frames = SubResource("SpriteFrames_en2x2")
animation = &"neutral"
autoplay = "neutral"
frame_progress = 0.807805