From dd05641f188599615b9bfacb1a7b1f4f3cdd1d17 Mon Sep 17 00:00:00 2001 From: Fabio Date: Sun, 18 Aug 2024 22:45:33 +0200 Subject: [PATCH] change goal animation --- gmtk_2024/objects/Goal.tscn | 63 ++++++++++++++++++++----- gmtk_2024/scripts/goal.gd | 8 +--- gmtk_2024/textures/01-Portal-Sheet.png | Bin 0 -> 2334 bytes 3 files changed, 52 insertions(+), 19 deletions(-) create mode 100644 gmtk_2024/textures/01-Portal-Sheet.png diff --git a/gmtk_2024/objects/Goal.tscn b/gmtk_2024/objects/Goal.tscn index 667594d..6d94b50 100644 --- a/gmtk_2024/objects/Goal.tscn +++ b/gmtk_2024/objects/Goal.tscn @@ -1,29 +1,66 @@ -[gd_scene load_steps=5 format=3 uid="uid://d0gpnqknarkg7"] +[gd_scene load_steps=7 format=3 uid="uid://d0gpnqknarkg7"] [ext_resource type="Script" path="res://scripts/goal.gd" id="1_xjaxa"] -[ext_resource type="Texture2D" uid="uid://hsp64ixwg2bb" path="res://temp_assets/goal.png" id="1_y0s3c"] -[ext_resource type="Texture2D" uid="uid://bs8mevd0fornj" path="res://temp_assets/goal_bg.png" id="2_mxvn8"] +[ext_resource type="Texture2D" uid="uid://bje753fyfin0" path="res://textures/01-Portal-Sheet.png" id="2_hsts4"] + +[sub_resource type="Animation" id="Animation_a6qt0"] +resource_name = "portal" +length = 0.55 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:frame_coords") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.0666667, 0.133333, 0.2, 0.266667, 0.333333, 0.4, 0.466667), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [Vector2i(0, 0), Vector2i(1, 0), Vector2i(2, 0), Vector2i(3, 0), Vector2i(4, 0), Vector2i(5, 0), Vector2i(6, 0), Vector2i(7, 0)] +} + +[sub_resource type="Animation" id="Animation_v2oub"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:frame_coords") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [Vector2i(0, 0)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_4pqp1"] +_data = { +"RESET": SubResource("Animation_v2oub"), +"portal": SubResource("Animation_a6qt0") +} [sub_resource type="CircleShape2D" id="CircleShape2D_fjcci"] -radius = 41.0488 +radius = 16.1245 -[node name="Goal" type="Area2D" node_paths=PackedStringArray("img", "img2")] -scale = Vector2(0.5, 0.5) +[node name="Goal" type="Area2D"] collision_layer = 0 collision_mask = 4 script = ExtResource("1_xjaxa") -img = NodePath("GoalImg") -img2 = NodePath("GoalBg") -[node name="GoalBg" type="Sprite2D" parent="."] +[node name="Sprite2D" type="Sprite2D" parent="."] z_index = -1 -position = Vector2(-4, 0) -texture = ExtResource("2_mxvn8") +texture = ExtResource("2_hsts4") +hframes = 8 -[node name="GoalImg" type="Sprite2D" parent="."] -texture = ExtResource("1_y0s3c") +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_4pqp1") +} [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource("CircleShape2D_fjcci") +[connection signal="area_entered" from="." to="." method="_on_area_entered"] [connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/gmtk_2024/scripts/goal.gd b/gmtk_2024/scripts/goal.gd index 89fa9d3..0b16d55 100644 --- a/gmtk_2024/scripts/goal.gd +++ b/gmtk_2024/scripts/goal.gd @@ -1,15 +1,11 @@ extends Node @export var next : PackedScene -@export var img : Sprite2D -@export var img2 : Sprite2D +@onready var animation = $AnimationPlayer func _process(delta: float) -> void: - img.rotate(2 * delta) - img2.rotate(1 * delta) - - + animation.play("portal") func _on_body_entered(body: Node2D) -> void: get_tree().change_scene_to_packed(next) diff --git a/gmtk_2024/textures/01-Portal-Sheet.png b/gmtk_2024/textures/01-Portal-Sheet.png new file mode 100644 index 0000000000000000000000000000000000000000..9b377ce1551c1263f110982f378bd1554e471f10 GIT binary patch literal 2334 zcmV+(3E}pMP)Px-zDYzuRCt{2oxM^cNeqBx%HArH3kY`u5(>wTF4>gG3B@bia}e$0qn}oH&lnpN89bg(-7TrrKhraSpq!o^uB`8$?%xK{dw%hE zhwtgI@8#b&{xAx^xI8kixqsR>p^H5ZLG9ESl=20mnCHZK4TCsidd4q1d{sA^YFqO}B z*~RwXcYfoKl<^HJ@;F$EQxwC!Ys_zW5S1mro7I;?tgo8W7hd!l(DL zoZzFjzof&y@YR_F$@r*2OvWQs3H-m+BY0vN{}(^T_wJRWLxi6)VHIIV`8o0t?Y|5D z0e;Y;&*N;dz9Cm?G9JOp^8j9+<*devQe0B_T)YB)B)(_R9$(U7G9H;a@ZbFSK7@A4+g3&EPjf@bSs25d@A;%zX-?l<)zdh+WFZ zNNnj4?SZv4&k6!wV_UtjWqcN!>JTw@kDpTiH6_aD9p3Rtzx=iy`Su^m&8U%6g)j)< zHK+)6(%dvu(*a;XBH&^jglHvb{L{0;vZ-s!a;CMZ zhugdNGHO8xgMg$%sz^Fa#?3&;`IKEETBZpAa6TQHokT7B1K89rwR!#>ml}ND$!K~+ zI-vvp53Tp1g_P2M3Z>uChNlw{+B&~A$-#Ay(nHBe=mZ#mo`za{sm!QDs+962p*nDb z-~ouP<7*NrKMDpOF5CfcuIBDcxYhp0Co9##Zts?B9@mpkfS#Tmu5#^PMMPDx>0RVjac?hQf;w~xf(BJ z4ubMMk@&Qy;fD5Z5KD6`O8K6_X>$!tezOj4@0P9J(Bsp6>lPo`Z3k<&yJice^^bBs z9m4J1k_Ci~UepmWP;q{={w@2KzKi%@qs63gf@R!`+57dQal7HE!C-+9tc?e)aZ-ej zWAj>kdOzAYoX>khjjxHuZ?gv?Uz1vV>VS*ca?Q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