From 884f49fed32ad5338fcb6289d1ae5c29e2588342 Mon Sep 17 00:00:00 2001 From: pennyrigate Date: Sun, 9 Mar 2025 12:41:26 -0400 Subject: [PATCH] :) --- assets/textures/rotoboy/rotoboy_face.png | Bin 442 -> 438 bytes assets/textures/rotoboy/rotoboy_smile.png | Bin 442 -> 442 bytes objects/rotoboy/roto_boy.gd | 2 + objects/rotoboy/roto_boy.tscn | 58 +++++++++++++++------- 4 files changed, 42 insertions(+), 18 deletions(-) diff --git a/assets/textures/rotoboy/rotoboy_face.png b/assets/textures/rotoboy/rotoboy_face.png index 138bb55df34da8f134e5dcb1b2b8416744778df2..6f49dbe4b29b9c28cf7cdeab31c28e013257039c 100644 GIT binary patch delta 181 zcmdnRyp4H+qnl`ePl&7e<~+-V8G--jGcYjxXSiejpb5yh<5JrSq}WS>{DS|30fUq` zvl~!|v%n*=n1O-s5C}7hYIrqF>@MT`RL02gf|-EB#Yhxj$yI2RUAQv6vGGV}Zf<=5@snS^8+ V+NQpZSq{|9;OXk;vd$@?2>|J!LU8~9 delta 185 zcmdnSyo-5)qnAX0Pl&7e<~+-V84L^zf&b_K2LgsW<`0^H+$Dl5b^|Gnk|4iekT?)9 z+-u$&2^8Zj@Q5sCVBk9p!i>lBSENjAFXKx9$}j>kgr3aJ7!~;P>Nks1w{oh0qK2L> zjv*4^qFpC>84P$1?U?mue<3G-j^c(L8z$te^m*elHCpTa&C6_S8XYbahbL7&tP_i5 Vn4i1d)e)$f!PC{xWt~$(69D1+Muz|Z diff --git a/assets/textures/rotoboy/rotoboy_smile.png b/assets/textures/rotoboy/rotoboy_smile.png index 747ee6fbee80366ac8dff451eccdb4e701fbed42..77784af3af7d4fb553b3fbdbe452530a233e034c 100644 GIT binary patch delta 174 zcmdnRyo-5)k39neL*W1U|ABzvj`@QoAa{x2irqkpqa?^L7$gn^4ELJ%Mgqk+3p^r= z85sBufiR<}hF8PH?lQhlWsD3jm>C!#^kja void: if is_zero_approx(speed): + %Head.play("normal") collision_shape.disabled = false rotation_pivot.rotation = 0.0 else: + %Head.play("happy") collision_shape.disabled = true rotation_pivot.rotation += rotation_speed * delta if _player: diff --git a/objects/rotoboy/roto_boy.tscn b/objects/rotoboy/roto_boy.tscn index 6f79ab1..f3d00a8 100644 --- a/objects/rotoboy/roto_boy.tscn +++ b/objects/rotoboy/roto_boy.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=10 format=3 uid="uid://bwtjfpfkykfdr"] +[gd_scene load_steps=12 format=3 uid="uid://bwtjfpfkykfdr"] [ext_resource type="Script" uid="uid://bt4bdjyekgh53" path="res://scripts/ball_snake/ball_snake.gd" id="1_7ck2q"] [ext_resource type="Script" uid="uid://doitxsfhjpfh0" path="res://objects/rotoboy/roto_boy.gd" id="1_pwab3"] [ext_resource type="Texture2D" uid="uid://cvgdwf28yr7fw" path="res://assets/textures/rotoboy/rotoboy.png" id="2_3s2uc"] [ext_resource type="Texture2D" uid="uid://ckfu1u3qxssrj" path="res://assets/textures/rotoboy/rotoboy_face.png" id="3_gp51k"] +[ext_resource type="Texture2D" uid="uid://bmohkn7gmnptg" path="res://assets/textures/rotoboy/rotoboy_smile.png" id="4_qes26"] [sub_resource type="CircleShape2D" id="CircleShape2D_pwab3"] radius = 24.0 @@ -11,6 +12,40 @@ radius = 24.0 [sub_resource type="RectangleShape2D" id="RectangleShape2D_8o2cr"] size = Vector2(48, 8) +[sub_resource type="SpriteFrames" id="SpriteFrames_5ig0v"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("4_qes26") +}], +"loop": true, +"name": &"happy", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3_gp51k") +}], +"loop": true, +"name": &"normal", +"speed": 5.0 +}] + +[sub_resource type="Animation" id="Animation_qes26"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:speed") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} + [sub_resource type="Animation" id="Animation_pwab3"] resource_name = "on_off" length = 3.0 @@ -29,21 +64,6 @@ tracks/0/keys = { "values": [0.0, 0.0, 1.0, 1.0, 1.0] } -[sub_resource type="Animation" id="Animation_qes26"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath(".:speed") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [0.0] -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_5ig0v"] _data = { &"RESET": SubResource("Animation_qes26"), @@ -96,8 +116,10 @@ tail_segment = false auto_density = true pixels_per_segment = 6.0 -[node name="Head" type="Sprite2D" parent="."] -texture = ExtResource("3_gp51k") +[node name="Head" type="AnimatedSprite2D" parent="."] +unique_name_in_owner = true +sprite_frames = SubResource("SpriteFrames_5ig0v") +animation = &"happy" [node name="AnimationPlayer" type="AnimationPlayer" parent="."] libraries = {