enhance #136 animations when skipping in picker
This commit is contained in:
parent
796b7d12c8
commit
c00cb4ba13
|
|
@ -110,7 +110,11 @@ func fill_post_slots():
|
||||||
options.append(sticky_notes[i])
|
options.append(sticky_notes[i])
|
||||||
$sticky_notes.get_child(i).add_child(options[i], false)
|
$sticky_notes.get_child(i).add_child(options[i], false)
|
||||||
options[i].owner = self
|
options[i].owner = self
|
||||||
|
|
||||||
|
|
||||||
|
var picked_player: AnimationPlayer
|
||||||
|
var random_player: AnimationPlayer
|
||||||
|
|
||||||
func _input(event):
|
func _input(event):
|
||||||
#if event.is_action_pressed("ui_end"):
|
#if event.is_action_pressed("ui_end"):
|
||||||
# fill_card_slots(3)
|
# fill_card_slots(3)
|
||||||
|
|
@ -125,12 +129,17 @@ func _input(event):
|
||||||
if event.is_action_pressed("ui_accept"):
|
if event.is_action_pressed("ui_accept"):
|
||||||
pick(curr_selection_id)
|
pick(curr_selection_id)
|
||||||
elif event.is_action_pressed("skip"):
|
elif event.is_action_pressed("skip"):
|
||||||
##fixme: using skip causes a lot of invalid state
|
|
||||||
if selection_state == CARDS_SELECTED:
|
if selection_state == CARDS_SELECTED:
|
||||||
|
picked_player.play("skip_pick", .1)
|
||||||
|
random_player.play("skip_shuffle", .1)
|
||||||
|
for player in anim_players:
|
||||||
|
player.advance(10.0)
|
||||||
transition()
|
transition()
|
||||||
show_posts()
|
show_posts()
|
||||||
elif selection_state == POSTS_SELECTED:
|
elif selection_state == POSTS_SELECTED:
|
||||||
transition()
|
transition()
|
||||||
|
for player in anim_players + [picked_player, random_player]:
|
||||||
|
player.advance(10.0)
|
||||||
elif selection_state == TRANSITION:
|
elif selection_state == TRANSITION:
|
||||||
show_posts()
|
show_posts()
|
||||||
|
|
||||||
|
|
@ -147,15 +156,16 @@ func pick(id: int):
|
||||||
selection_state = POSTS_SELECTED
|
selection_state = POSTS_SELECTED
|
||||||
|
|
||||||
anim_players[id].play("pick")
|
anim_players[id].play("pick")
|
||||||
|
picked_player = anim_players[id]
|
||||||
var yield_to = anim_players[id].animation_finished
|
var yield_to = anim_players[id].animation_finished
|
||||||
output.append(options[id])
|
output.append(options[id])
|
||||||
|
|
||||||
options.remove_at(id)
|
options.remove_at(id)
|
||||||
anim_players.remove_at(id)
|
anim_players.remove_at(id)
|
||||||
|
|
||||||
var parent_id = -1
|
var parent_id:StringName
|
||||||
if selection_state == POSTS_SELECTED:
|
if selection_state == POSTS_SELECTED:
|
||||||
parent_id = options.find(output[-1].parent_id)
|
parent_id = output[-1].parent_id
|
||||||
var i:int = 0
|
var i:int = 0
|
||||||
for option:StickyNote in options:
|
for option:StickyNote in options:
|
||||||
if option.parent_id == parent_id:
|
if option.parent_id == parent_id:
|
||||||
|
|
@ -179,6 +189,7 @@ func pick(id: int):
|
||||||
Steam.storeStats()
|
Steam.storeStats()
|
||||||
|
|
||||||
output.append(options.pop_at(winning_id))
|
output.append(options.pop_at(winning_id))
|
||||||
|
random_player = anim_players[winning_id]
|
||||||
anim_players.pop_at(winning_id).play("shuffle")
|
anim_players.pop_at(winning_id).play("shuffle")
|
||||||
|
|
||||||
for anim in anim_players:
|
for anim in anim_players:
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=64 format=3 uid="uid://brk4hjdf2x81a"]
|
[gd_scene load_steps=70 format=3 uid="uid://brk4hjdf2x81a"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bdb6n10apk1en" path="res://logic-scenes/card_picker/card_picker.gd" id="1_pjntm"]
|
[ext_resource type="Script" uid="uid://bdb6n10apk1en" path="res://logic-scenes/card_picker/card_picker.gd" id="1_pjntm"]
|
||||||
[ext_resource type="Script" uid="uid://2loic2eeec5b" path="res://logic-scenes/board/card.gd" id="2_f4sp4"]
|
[ext_resource type="Script" uid="uid://2loic2eeec5b" path="res://logic-scenes/board/card.gd" id="2_f4sp4"]
|
||||||
|
|
@ -219,6 +219,86 @@ tracks/2/keys = {
|
||||||
"values": [Vector2(1, 1), Vector2(1, 1), Vector2(1.2, 1.2)]
|
"values": [Vector2(1, 1), Vector2(1, 1), Vector2(1.2, 1.2)]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_t7byf"]
|
||||||
|
resource_name = "skip_pick"
|
||||||
|
length = 2.0
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath(".:position")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0.6, 1.26667, 1.96667),
|
||||||
|
"transitions": PackedFloat32Array(1.7411, 1.7411, 0.450625),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(-110, 350), Vector2(-110, 400), Vector2(-110, 900)]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath(".:rotation")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0.6, 1.83333),
|
||||||
|
"transitions": PackedFloat32Array(2.14355, 1.03526),
|
||||||
|
"update": 0,
|
||||||
|
"values": [0.0523599, 0.0]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath(".:scale")
|
||||||
|
tracks/2/interp = 2
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0.9),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(1.2, 1.2)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_et74x"]
|
||||||
|
resource_name = "skip_shuffle"
|
||||||
|
length = 1.7
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath(".:position")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0.566667, 1, 1.7),
|
||||||
|
"transitions": PackedFloat32Array(1.7411, 2.37841, 0.450625),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(200, 390), Vector2(200, 400), Vector2(200, 900)]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath(".:rotation")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0.566667, 1.43333),
|
||||||
|
"transitions": PackedFloat32Array(2.14355, 1.03526),
|
||||||
|
"update": 0,
|
||||||
|
"values": [0.111701, 0.0]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath(".:scale")
|
||||||
|
tracks/2/interp = 2
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0.866667),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(1.2, 1.2)]
|
||||||
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_d68d2"]
|
[sub_resource type="Animation" id="Animation_d68d2"]
|
||||||
resource_name = "unshuffle"
|
resource_name = "unshuffle"
|
||||||
length = 3.0
|
length = 3.0
|
||||||
|
|
@ -255,6 +335,8 @@ _data = {
|
||||||
&"reveal": SubResource("Animation_3304u"),
|
&"reveal": SubResource("Animation_3304u"),
|
||||||
&"select": SubResource("Animation_ldr2c"),
|
&"select": SubResource("Animation_ldr2c"),
|
||||||
&"shuffle": SubResource("Animation_abihp"),
|
&"shuffle": SubResource("Animation_abihp"),
|
||||||
|
&"skip_pick": SubResource("Animation_t7byf"),
|
||||||
|
&"skip_shuffle": SubResource("Animation_et74x"),
|
||||||
&"unshuffle": SubResource("Animation_d68d2")
|
&"unshuffle": SubResource("Animation_d68d2")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -449,6 +531,86 @@ tracks/2/keys = {
|
||||||
"values": [Vector2(1, 1), Vector2(1, 1), Vector2(1.2, 1.2)]
|
"values": [Vector2(1, 1), Vector2(1, 1), Vector2(1.2, 1.2)]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_f4sp4"]
|
||||||
|
resource_name = "skip_pick"
|
||||||
|
length = 2.0
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath(".:position")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0.6, 1.26667, 1.96667),
|
||||||
|
"transitions": PackedFloat32Array(1.7411, 1.7411, 0.450625),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(-110, 350), Vector2(-110, 400), Vector2(-110, 900)]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath(".:rotation")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0.6, 1.83333),
|
||||||
|
"transitions": PackedFloat32Array(2.14355, 1.03526),
|
||||||
|
"update": 0,
|
||||||
|
"values": [0.0523599, 0.0]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath(".:scale")
|
||||||
|
tracks/2/interp = 2
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0.9),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(1.2, 1.2)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_211mu"]
|
||||||
|
resource_name = "skip_shuffle"
|
||||||
|
length = 1.7
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath(".:position")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0.533333, 0.966667, 1.66667),
|
||||||
|
"transitions": PackedFloat32Array(1.7411, 2.37841, 0.450625),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(200, 390), Vector2(200, 400), Vector2(200, 900)]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath(".:rotation")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0.533333, 1.4),
|
||||||
|
"transitions": PackedFloat32Array(2.14355, 1.03526),
|
||||||
|
"update": 0,
|
||||||
|
"values": [0.111701, 0.0]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath(".:scale")
|
||||||
|
tracks/2/interp = 2
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0.833333),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(1.2, 1.2)]
|
||||||
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_sa974"]
|
[sub_resource type="Animation" id="Animation_sa974"]
|
||||||
resource_name = "unshuffle"
|
resource_name = "unshuffle"
|
||||||
length = 3.0
|
length = 3.0
|
||||||
|
|
@ -485,6 +647,8 @@ _data = {
|
||||||
&"reveal": SubResource("Animation_orrwn"),
|
&"reveal": SubResource("Animation_orrwn"),
|
||||||
&"select": SubResource("Animation_2c94q"),
|
&"select": SubResource("Animation_2c94q"),
|
||||||
&"shuffle": SubResource("Animation_pdic8"),
|
&"shuffle": SubResource("Animation_pdic8"),
|
||||||
|
&"skip_pick": SubResource("Animation_f4sp4"),
|
||||||
|
&"skip_shuffle": SubResource("Animation_211mu"),
|
||||||
&"unshuffle": SubResource("Animation_sa974")
|
&"unshuffle": SubResource("Animation_sa974")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -703,6 +867,86 @@ tracks/2/keys = {
|
||||||
"values": [Vector2(1, 1), Vector2(1, 1), Vector2(1.2, 1.2)]
|
"values": [Vector2(1, 1), Vector2(1, 1), Vector2(1.2, 1.2)]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_8qj35"]
|
||||||
|
resource_name = "skip_pick"
|
||||||
|
length = 2.0
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath(".:position")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0.6, 1.26667, 1.96667),
|
||||||
|
"transitions": PackedFloat32Array(1.7411, 1.7411, 0.450625),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(-110, 350), Vector2(-110, 400), Vector2(-110, 900)]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath(".:rotation")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0.6, 1.83333),
|
||||||
|
"transitions": PackedFloat32Array(2.14355, 1.03526),
|
||||||
|
"update": 0,
|
||||||
|
"values": [0.0523599, 0.0]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath(".:scale")
|
||||||
|
tracks/2/interp = 2
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0.9),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(1.2, 1.2)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_ujc5a"]
|
||||||
|
resource_name = "skip_shuffle"
|
||||||
|
length = 1.7
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath(".:position")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0.566667, 1, 1.7),
|
||||||
|
"transitions": PackedFloat32Array(1.7411, 2.37841, 0.450625),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(200, 390), Vector2(200, 400), Vector2(200, 900)]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath(".:rotation")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0.566667, 1.43333),
|
||||||
|
"transitions": PackedFloat32Array(2.14355, 1.03526),
|
||||||
|
"update": 0,
|
||||||
|
"values": [0.111701, 0.0]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath(".:scale")
|
||||||
|
tracks/2/interp = 2
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0.866667),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(1.2, 1.2)]
|
||||||
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_mj8e0"]
|
[sub_resource type="Animation" id="Animation_mj8e0"]
|
||||||
resource_name = "unshuffle"
|
resource_name = "unshuffle"
|
||||||
length = 3.0
|
length = 3.0
|
||||||
|
|
@ -739,6 +983,8 @@ _data = {
|
||||||
&"reveal": SubResource("Animation_ep22n"),
|
&"reveal": SubResource("Animation_ep22n"),
|
||||||
&"select": SubResource("Animation_pcu23"),
|
&"select": SubResource("Animation_pcu23"),
|
||||||
&"shuffle": SubResource("Animation_vu874"),
|
&"shuffle": SubResource("Animation_vu874"),
|
||||||
|
&"skip_pick": SubResource("Animation_8qj35"),
|
||||||
|
&"skip_shuffle": SubResource("Animation_ujc5a"),
|
||||||
&"unshuffle": SubResource("Animation_mj8e0")
|
&"unshuffle": SubResource("Animation_mj8e0")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue