apply animation to other pieces

This commit is contained in:
Fabien Freling 2019-12-03 13:50:42 +01:00
parent ce3b060487
commit 6753848c8f
4 changed files with 48 additions and 20 deletions

View file

@ -1,12 +1,15 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]
[ext_resource path="res://src/Taquin.gd" type="Script" id=1]
[ext_resource path="res://src/Piece.tscn" type="PackedScene" id=2]
[sub_resource type="Animation" id=1]
resource_name = "MovingPiece"
length = 0.2
step = 0.01
tracks/0/type = "value"
tracks/0/path = NodePath("AnimationPlayer/MockPiece:rect_position")
tracks/0/interp = 2
tracks/0/path = NodePath("AnimationPlayer/MockPiece:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
@ -14,7 +17,7 @@ tracks/0/keys = {
"times": PoolRealArray( 0, 0.2 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( 176, 338 ), Vector2( 338, 338 ) ]
"values": [ Vector2( 15, 15 ), Vector2( 175, 15 ) ]
}
[node name="Taquin" type="Node2D"]
@ -23,7 +26,7 @@ rows = 3
columns = 3
difficulty = 0
[node name="ColorRect" type="ColorRect" parent="."]
[node name="Background" type="ColorRect" parent="."]
margin_right = 512.0
margin_bottom = 512.0
color = Color( 0.254902, 0.329412, 0.45098, 1 )
@ -31,10 +34,11 @@ color = Color( 0.254902, 0.329412, 0.45098, 1 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/MovingPiece = SubResource( 1 )
[node name="MockPiece" type="ColorRect" parent="AnimationPlayer"]
visible = false
margin_left = 176.0
margin_top = 338.0
margin_right = 336.001
margin_bottom = 498.0
color = Color( 0.345098, 0.980392, 0.113725, 1 )
[node name="MockPiece" parent="AnimationPlayer" instance=ExtResource( 2 )]
position = Vector2( 175, 15 )
size = 160
[node name="PlaceholderTexture" type="ColorRect" parent="AnimationPlayer/MockPiece"]
margin_right = 160.0
margin_bottom = 160.0
color = Color( 0.137255, 0.976471, 0.0196078, 1 )