[gd_scene load_steps=28 format=2]

[ext_resource path="res://Scripts/Personaje.gd" type="Script" id=1]
[ext_resource path="res://Assets/personaje/pj_globo.png" type="Texture" id=2]
[ext_resource path="res://Assets/personaje/pj_barco_2.png" type="Texture" id=3]
[ext_resource path="res://Sounds/sfx/disparo.ogg" type="AudioStream" id=4]

[sub_resource type="AtlasTexture" id=2]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 0, 0, 296, 165 )

[sub_resource type="AtlasTexture" id=3]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 296, 0, 296, 165 )

[sub_resource type="AtlasTexture" id=4]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 592, 0, 296, 165 )

[sub_resource type="AtlasTexture" id=5]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 888, 0, 296, 165 )

[sub_resource type="AtlasTexture" id=6]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 1184, 0, 296, 165 )

[sub_resource type="SpriteFrames" id=7]
animations = [ {
"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ) ],
"loop": true,
"name": "idle",
"speed": 15.0
} ]

[sub_resource type="CapsuleShape2D" id=1]
radius = 82.0333
height = 86.2177

[sub_resource type="Animation" id=8]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("Globo:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 0.0 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ) ]
}

[sub_resource type="Animation" id=9]
resource_name = "move_left"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("Globo:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ 0.0, 4.0 ]
}

[sub_resource type="Animation" id=10]
resource_name = "move_right"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("Globo:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ 0.0, -4.0 ]
}

[sub_resource type="Animation" id=21]
resource_name = "take_damage"
length = 3.0
tracks/0/type = "value"
tracks/0/path = NodePath(".:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5, 1, 1.5, 2, 2.5, 3 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ), Color( 0.811765, 0.156863, 0.156863, 1 ), Color( 1, 1, 1, 1 ), Color( 0.811765, 0.156863, 0.156863, 1 ), Color( 1, 1, 1, 1 ), Color( 0.811765, 0.156863, 0.156863, 1 ), Color( 1, 1, 1, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:collision_layer")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 3 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ 0, 1 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath(".:collision_mask")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 3 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ 0, 1 ]
}

[sub_resource type="AnimationNodeAnimation" id=11]
animation = "RESET"

[sub_resource type="AnimationNodeAnimation" id=12]
animation = "move_left"

[sub_resource type="AnimationNodeAnimation" id=13]
animation = "move_right"

[sub_resource type="AnimationNodeStateMachineTransition" id=14]

[sub_resource type="AnimationNodeStateMachineTransition" id=15]

[sub_resource type="AnimationNodeStateMachineTransition" id=16]

[sub_resource type="AnimationNodeStateMachineTransition" id=17]

[sub_resource type="AnimationNodeStateMachine" id=18]
states/RESET/node = SubResource( 11 )
states/RESET/position = Vector2( 385, 116 )
states/move_left/node = SubResource( 12 )
states/move_left/position = Vector2( 177, 121 )
states/move_right/node = SubResource( 13 )
states/move_right/position = Vector2( 599, 121 )
transitions = [ "RESET", "move_right", SubResource( 14 ), "move_right", "RESET", SubResource( 15 ), "RESET", "move_left", SubResource( 16 ), "move_left", "RESET", SubResource( 17 ) ]
graph_offset = Vector2( -109.483, 0 )

[sub_resource type="AnimationNodeStateMachinePlayback" id=19]

[sub_resource type="CapsuleShape2D" id=20]
radius = 96.0

[sub_resource type="Animation" id=22]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath(".:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:collision_layer")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 1 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath(".:collision_mask")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 1 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Area2D:collision_layer")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 1 ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Area2D:collision_mask")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 1 ]
}

[sub_resource type="Animation" id=23]
resource_name = "take_damage"
length = 3.0
tracks/0/type = "value"
tracks/0/path = NodePath(".:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5, 1, 1.5, 2, 2.5, 3 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ), Color( 0.768627, 0.14902, 0.14902, 1 ), Color( 1, 1, 1, 1 ), Color( 0.768627, 0.14902, 0.14902, 1 ), Color( 1, 1, 1, 1 ), Color( 0.768627, 0.14902, 0.14902, 1 ), Color( 1, 1, 1, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:collision_layer")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 3 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ 0, 1 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath(".:collision_mask")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 3 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ 0, 1 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Area2D:collision_layer")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0, 3 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ 0, 1 ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Area2D:collision_mask")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0, 3 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ 0, 1 ]
}

[node name="Personaje" type="KinematicBody2D" groups=["personaje"]]
position = Vector2( 400, 519 )
script = ExtResource( 1 )

[node name="Barco" type="AnimatedSprite" parent="."]
position = Vector2( -6, 26 )
frames = SubResource( 7 )
animation = "idle"
frame = 1
playing = true

[node name="Globo" type="Sprite" parent="."]
position = Vector2( 2, -50 )
texture = ExtResource( 2 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
rotation = 1.58723
shape = SubResource( 1 )

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/RESET = SubResource( 8 )
anims/move_left = SubResource( 9 )
anims/move_right = SubResource( 10 )
anims/take_damage = SubResource( 21 )

[node name="AnimationTree" type="AnimationTree" parent="."]
tree_root = SubResource( 18 )
anim_player = NodePath("../AnimationPlayer")
active = true
parameters/playback = SubResource( 19 )

[node name="Timer" type="Timer" parent="."]
wait_time = 0.2

[node name="DisparoPos" type="Position2D" parent="."]
position = Vector2( 130, 38 )

[node name="Area2D" type="Area2D" parent="."]

[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
self_modulate = Color( 0.270588, 1, 0.0392157, 1 )
position = Vector2( 1, -1 )
shape = SubResource( 20 )

[node name="DamageAnim" type="AnimationPlayer" parent="."]
anims/RESET = SubResource( 22 )
anims/take_damage = SubResource( 23 )

[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 4 )
bus = "SFX"

[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]
[connection signal="area_entered" from="Area2D" to="." method="_on_Area2D_area_entered"]
