change goal animation
This commit is contained in:
parent
d137d205ff
commit
dd05641f18
3 changed files with 52 additions and 19 deletions
|
@ -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"]
|
||||
|
|
|
@ -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)
|
||||
|
|
BIN
gmtk_2024/textures/01-Portal-Sheet.png
Normal file
BIN
gmtk_2024/textures/01-Portal-Sheet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Loading…
Add table
Reference in a new issue