From 8878a0f770730b3c54564d29c112a3cedadb2dad Mon Sep 17 00:00:00 2001 From: pennyrigate Date: Sat, 1 Mar 2025 22:05:14 -0500 Subject: [PATCH] rotoboy --- assets/textures/rotoboy/rotoboy.png | Bin 0 -> 431 bytes assets/textures/rotoboy/rotoboy.png.import | 34 +++++++ assets/textures/rotoboy/rotoboy_face.png | Bin 0 -> 442 bytes .../textures/rotoboy/rotoboy_face.png.import | 34 +++++++ assets/textures/rotoboy/rotoboy_smile.png | Bin 0 -> 442 bytes maps/level1.tscn | 13 +-- objects/rotoboy/roto_boy.tscn | 90 +++++++++++++++++- 7 files changed, 160 insertions(+), 11 deletions(-) create mode 100644 assets/textures/rotoboy/rotoboy.png create mode 100644 assets/textures/rotoboy/rotoboy.png.import create mode 100644 assets/textures/rotoboy/rotoboy_face.png create mode 100644 assets/textures/rotoboy/rotoboy_face.png.import create mode 100644 assets/textures/rotoboy/rotoboy_smile.png diff --git a/assets/textures/rotoboy/rotoboy.png b/assets/textures/rotoboy/rotoboy.png new file mode 100644 index 0000000000000000000000000000000000000000..aaa8ec85672bdf995363030ef543bbfd2aa325ca GIT binary patch literal 431 zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxf7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`0(2Ka=yW=O7xlbQVg|Nl#K{x3EE-y(S%C=_%1wDMnTXMxd}45KBYZARlNjGK0mLfNVoXCI$f@9RMK9w;tya0L>Mx$BE0F;`*&cFgxX<%e*z__0NEhG1T>cktTM>b z0?2~uGBhv%$@Wk44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`031o(uwns3gtT$lmm1^%D^9|#!km_KL&a+e6M*bSsON`m}?LE=EbaIbl9 zBv6dAz$3Dlfr0NZ2s0kfUy%Y7lqhkHC<)F_D=AMbN@WO0%*-p%^K%VRFx4~EGy1)U zc^gp8w$upEG*3@0usc~9q!?Kl7=glGKr9VqgM6XE$P5-|0!MXrq(i9*Y1ek#4Fo9JDSy}*D zP+f)w1|Zp&SHD@Dx|LG}WEy(9IEF}si*}vlWia45v}4wr{e_(TIf@&0Y?zR<(&vrK q)M%~uH!riTX>_k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`031o(uwns3gtT$mB~e?Cy)KM*k7F@MkmWSX6 zs4hbT1CZ>?tKTe6-O8x~G7UXl9780+WxF;qGAQsIYKZv#|M<4F2A;s|k1=+SCo~+5 ov|ORJbMxhZR-NaEmSpL_V;8x{F#EbHw>!unPgg&ebxsLQ0LyV`u>b%7 literal 0 HcmV?d00001 diff --git a/maps/level1.tscn b/maps/level1.tscn index 4fed9cc..77a9c7c 100644 --- a/maps/level1.tscn +++ b/maps/level1.tscn @@ -5,9 +5,7 @@ [ext_resource type="TileSet" uid="uid://xwfn24if3pxk" path="res://assets/tilesets/chocomint.tres" id="3_4td23"] [ext_resource type="PackedScene" uid="uid://68lav5rke5ag" path="res://objects/spring/spring.tscn" id="4_a3xei"] [ext_resource type="PackedScene" uid="uid://b5eso40mjhlmv" path="res://objects/ice/ice.tscn" id="5_88a5a"] - -[sub_resource type="RectangleShape2D" id="RectangleShape2D_fbct2"] -size = Vector2(74, 2) +[ext_resource type="PackedScene" uid="uid://bwtjfpfkykfdr" path="res://objects/rotoboy/roto_boy.tscn" id="6_pjulc"] [node name="Level1" type="Node2D"] @@ -56,10 +54,5 @@ position = Vector2(88, 184) [node name="Ice5" parent="." instance=ExtResource("5_88a5a")] position = Vector2(104, 184) -[node name="StaticBody2D" type="StaticBody2D" parent="."] -position = Vector2(72, 144) -rotation = -0.433871 - -[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"] -position = Vector2(8, 0) -shape = SubResource("RectangleShape2D_fbct2") +[node name="RotoBoy" parent="." instance=ExtResource("6_pjulc")] +position = Vector2(112, 144) diff --git a/objects/rotoboy/roto_boy.tscn b/objects/rotoboy/roto_boy.tscn index eb48579..930c70f 100644 --- a/objects/rotoboy/roto_boy.tscn +++ b/objects/rotoboy/roto_boy.tscn @@ -1,3 +1,91 @@ -[gd_scene format=3 uid="uid://bwtjfpfkykfdr"] +[gd_scene load_steps=9 format=3 uid="uid://bwtjfpfkykfdr"] + +[ext_resource type="Script" path="res://scripts/ball_snake.gd" id="1_7ck2q"] +[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"] + +[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_sc2kd"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_8o2cr"] +size = Vector2(48, 8) + +[sub_resource type="Animation" id="Animation_eby5m"] +resource_name = "spin" +length = 5.0 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("RotatingPiece:rotation") +tracks/0/interp = 1 +tracks/0/loop_wrap = false +tracks/0/keys = { +"times": PackedFloat32Array(-0.0333333, 3, 4.2), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [0.0, 0.0, 12.5664] +} + +[sub_resource type="Animation" id="Animation_bsslc"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("RotatingPiece:rotation") +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_l3464"] +_data = { +"RESET": SubResource("Animation_bsslc"), +"spin": SubResource("Animation_eby5m") +} [node name="RotoBoy" type="Node2D"] + +[node name="RotatingPiece" type="Node2D" parent="."] + +[node name="SnakeEndLeft" type="Node2D" parent="RotatingPiece"] +position = Vector2(-20, 0) + +[node name="SnakeEndRight" type="Node2D" parent="RotatingPiece"] +position = Vector2(20, 0) + +[node name="AnimatableBody2D" type="AnimatableBody2D" parent="RotatingPiece"] +physics_material_override = SubResource("PhysicsMaterial_sc2kd") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="RotatingPiece/AnimatableBody2D"] +shape = SubResource("RectangleShape2D_8o2cr") + +[node name="BallSnakeLeft" type="Node2D" parent="." node_paths=PackedStringArray("target")] +script = ExtResource("1_7ck2q") +texture = ExtResource("2_3s2uc") +target = NodePath("../RotatingPiece/SnakeEndLeft") +segments = 2 +tail_segment = false +auto_density = true +pixels_per_segment = 6.0 + +[node name="BallSnakeRight" type="Node2D" parent="." node_paths=PackedStringArray("target")] +script = ExtResource("1_7ck2q") +texture = ExtResource("2_3s2uc") +target = NodePath("../RotatingPiece/SnakeEndRight") +segments = 2 +tail_segment = false +auto_density = true +pixels_per_segment = 6.0 + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("3_gp51k") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_l3464") +} +autoplay = "spin"