smashball/scenes/player/player.tscn
2025-11-19 15:27:24 -03:00

649 lines
17 KiB
Text

[gd_scene load_steps=40 format=3 uid="uid://642nm6c4mpxx"]
[ext_resource type="Script" uid="uid://rdqmsvofiots" path="res://scenes/player/player.gd" id="1_v6fml"]
[ext_resource type="Texture2D" uid="uid://b8ptokcqwpdud" path="res://scenes/player/saffron.png" id="2_3li8b"]
[ext_resource type="Texture2D" uid="uid://ca744qwgmwejx" path="res://scenes/player/assets/bnuuy-spritesheet.png" id="3_0owmy"]
[ext_resource type="Script" uid="uid://dqjaxgmyxq3rx" path="res://classes/state_machine/state_machine.gd" id="3_lvxji"]
[ext_resource type="Script" uid="uid://delyni51vg6us" path="res://scenes/player/states/player_idle.gd" id="4_75vfm"]
[ext_resource type="Script" uid="uid://dxfs1b8fuk7kv" path="res://scenes/player/states/player_running.gd" id="5_75vfm"]
[ext_resource type="Script" uid="uid://n7v8leojhykt" path="res://scenes/player/states/player_hitting.gd" id="6_75vfm"]
[sub_resource type="Animation" id="Animation_gx1jg"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:animation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [&"idle_up"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("AnimatedSprite2D:speed_scale")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [1.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("AnimatedSprite2D:offset:y")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [-16.0]
}
[sub_resource type="Animation" id="Animation_fcs02"]
resource_name = "hit_left_down"
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:animation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [&"idle_down"]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0]
}
[sub_resource type="Animation" id="Animation_h17s1"]
resource_name = "hit_left_up"
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:animation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [&"idle_up"]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0]
}
[sub_resource type="Animation" id="Animation_kvlxm"]
resource_name = "hit_power_down"
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:animation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [&"idle_down"]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [2]
}
[sub_resource type="Animation" id="Animation_myrg7"]
resource_name = "hit_power_up"
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:animation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [&"idle_up"]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [2]
}
[sub_resource type="Animation" id="Animation_ugbui"]
resource_name = "hit_right_down"
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:animation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [&"idle_down"]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [2]
}
[sub_resource type="Animation" id="Animation_je7p5"]
resource_name = "hit_right_up"
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:animation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [&"idle_up"]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [2]
}
[sub_resource type="Animation" id="Animation_fm80t"]
resource_name = "idle_down"
length = 2.0
loop_mode = 1
step = 0.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:frame")
tracks/0/interp = 0
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.6800001, 1.1299999, 1.7200001),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 1]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:animation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [&"idle_down"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("AnimatedSprite2D:speed_scale")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
[sub_resource type="Animation" id="Animation_0owmy"]
resource_name = "idle_up"
length = 2.0
loop_mode = 1
step = 0.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:frame")
tracks/0/interp = 0
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.6800001, 1.1299999, 1.7200001),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 1]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:animation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [&"idle_up"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("AnimatedSprite2D:speed_scale")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
[sub_resource type="Animation" id="Animation_5gtgg"]
resource_name = "walk_left"
length = 0.475
loop_mode = 1
step = 0.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:frame")
tracks/0/interp = 0
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.12206663, 0.20329137, 0.37493116),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 1,
"values": [1, 0, 1, 2]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:animation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [&"right"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("AnimatedSprite2D:speed_scale")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("AnimatedSprite2D:offset:y")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.12206663, 0.20329137, 0.37493116),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 1,
"values": [-16.0, -18.0, -16.0, -18.0]
}
[sub_resource type="Animation" id="Animation_qek5x"]
resource_name = "walk_right"
length = 0.475
loop_mode = 1
step = 0.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:frame")
tracks/0/interp = 0
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.12206663, 0.20329137, 0.37493116),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 1,
"values": [1, 0, 1, 2]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:animation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [&"right"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("AnimatedSprite2D:speed_scale")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("AnimatedSprite2D:offset:y")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.12206663, 0.20329137, 0.37493116),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 1,
"values": [-16.0, -18.0, -16.0, -18.0]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ugbui"]
_data = {
&"RESET": SubResource("Animation_gx1jg"),
&"hit_left_down": SubResource("Animation_fcs02"),
&"hit_left_up": SubResource("Animation_h17s1"),
&"hit_power_down": SubResource("Animation_kvlxm"),
&"hit_power_up": SubResource("Animation_myrg7"),
&"hit_right_down": SubResource("Animation_ugbui"),
&"hit_right_up": SubResource("Animation_je7p5"),
&"idle_down": SubResource("Animation_fm80t"),
&"idle_up": SubResource("Animation_0owmy"),
&"walk_left": SubResource("Animation_5gtgg"),
&"walk_right": SubResource("Animation_qek5x")
}
[sub_resource type="AtlasTexture" id="AtlasTexture_g2els"]
atlas = ExtResource("2_3li8b")
region = Rect2(0, 64, 24, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_qhqgy"]
atlas = ExtResource("2_3li8b")
region = Rect2(24, 64, 24, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_dqkch"]
atlas = ExtResource("2_3li8b")
region = Rect2(48, 64, 24, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_qek5x"]
atlas = ExtResource("3_0owmy")
region = Rect2(96, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_5gtgg"]
atlas = ExtResource("3_0owmy")
region = Rect2(128, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_h17s1"]
atlas = ExtResource("3_0owmy")
region = Rect2(160, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_0owmy"]
atlas = ExtResource("3_0owmy")
region = Rect2(192, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_je7p5"]
atlas = ExtResource("3_0owmy")
region = Rect2(224, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_fm80t"]
atlas = ExtResource("3_0owmy")
region = Rect2(256, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_myrg7"]
atlas = ExtResource("3_0owmy")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_kvlxm"]
atlas = ExtResource("3_0owmy")
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_uf5tr"]
atlas = ExtResource("3_0owmy")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_gx1jg"]
atlas = ExtResource("3_0owmy")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_ugbui"]
atlas = ExtResource("3_0owmy")
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_fcs02"]
atlas = ExtResource("3_0owmy")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_d2wvv"]
atlas = ExtResource("2_3li8b")
region = Rect2(48, 0, 24, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_3v2ag"]
atlas = ExtResource("2_3li8b")
region = Rect2(24, 0, 24, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_jej6c"]
atlas = ExtResource("2_3li8b")
region = Rect2(0, 0, 24, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_f1ej7"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_g2els")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qhqgy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dqkch")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qhqgy")
}],
"loop": true,
"name": &"down",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_qek5x")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5gtgg")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_h17s1")
}],
"loop": true,
"name": &"idle_down",
"speed": 0.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_0owmy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_je7p5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fm80t")
}],
"loop": true,
"name": &"idle_up",
"speed": 0.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_myrg7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kvlxm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_uf5tr")
}],
"loop": true,
"name": &"left",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_gx1jg")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ugbui")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fcs02")
}],
"loop": true,
"name": &"right",
"speed": 0.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_d2wvv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3v2ag")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jej6c")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3v2ag")
}],
"loop": true,
"name": &"up",
"speed": 5.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_0owmy"]
radius = 8.0
[node name="Player" type="CharacterBody2D"]
collision_layer = 2
collision_mask = 13
script = ExtResource("1_v6fml")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_ugbui")
}
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_f1ej7")
animation = &"idle_up"
frame = 1
offset = Vector2(0, -16)
flip_h = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(-1, -8)
shape = SubResource("CircleShape2D_0owmy")
[node name="StateMachine" type="Node" parent="." node_paths=PackedStringArray("initial_state")]
script = ExtResource("3_lvxji")
initial_state = NodePath("Idle")
metadata/_custom_type_script = "uid://dqjaxgmyxq3rx"
[node name="Idle" type="Node" parent="StateMachine"]
script = ExtResource("4_75vfm")
metadata/_custom_type_script = "uid://b2sr7p80gdjii"
[node name="Running" type="Node" parent="StateMachine"]
script = ExtResource("5_75vfm")
metadata/_custom_type_script = "uid://b2sr7p80gdjii"
[node name="Hitting" type="Node" parent="StateMachine"]
script = ExtResource("6_75vfm")
metadata/_custom_type_script = "uid://b2sr7p80gdjii"
[node name="HitTimer" type="Timer" parent="."]
wait_time = 0.5
one_shot = true
[node name="PowerTimer" type="Timer" parent="."]
wait_time = 0.847
autostart = true