aboutsummaryrefslogtreecommitdiff
path: root/client/player/character/cat_ears.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/player/character/cat_ears.gd')
-rw-r--r--client/player/character/cat_ears.gd34
1 files changed, 34 insertions, 0 deletions
diff --git a/client/player/character/cat_ears.gd b/client/player/character/cat_ears.gd
new file mode 100644
index 00000000..fbf2c8e2
--- /dev/null
+++ b/client/player/character/cat_ears.gd
@@ -0,0 +1,34 @@
+# Hurry Curry! - a game about cooking
+# Copyright 2025 nokoe
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, version 3 of the License only.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+class_name CatEars
+extends Node3D
+
+const EAR_ROTATION := deg_to_rad(20.)
+var ear_target := 0.
+
+func set_inner_mat(mat: BaseMaterial3D):
+ $Left.set_surface_override_material(1, mat)
+ $Right.set_surface_override_material(1, mat)
+
+
+func set_outer_mat(mat: BaseMaterial3D):
+ $Left.set_surface_override_material(0, mat)
+ $Right.set_surface_override_material(0, mat)
+
+func _process(delta: float) -> void:
+ if visible:
+ $Right.rotation.z = G.interpolate_angle($Right.rotation.z, ear_target + EAR_ROTATION, delta * 10.)
+ $Left.rotation.z = G.interpolate_angle($Left.rotation.z, PI + ear_target + EAR_ROTATION, delta * 10.)