/
Player1.tscn
122 lines (102 loc) · 3.65 KB
/
Player1.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
[gd_scene load_steps=13 format=2]
[ext_resource path="res://Player1_SpriteFrames_Orange.tres" type="SpriteFrames" id=1]
[ext_resource path="res://Player1_Script.gd" type="Script" id=2]
[ext_resource path="res://Health.gd" type="Script" id=3]
[ext_resource path="res://AttackArea.gd" type="Script" id=4]
[ext_resource path="res://ShoveAnimation.tres" type="SpriteFrames" id=5]
[ext_resource path="res://Game assets/Shove.mp3" type="AudioStream" id=6]
[ext_resource path="res://Game assets/Jump.mp3" type="AudioStream" id=7]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.207843, 0.745098, 0.172549, 1 )
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color( 1, 0.992157, 0.992157, 1 )
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
[sub_resource type="StyleBoxFlat" id=2]
bg_color = Color( 0.219608, 0.207843, 0.207843, 1 )
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color( 1, 0.992157, 0.992157, 1 )
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
[sub_resource type="CapsuleShape2D" id=3]
radius = 30.244
height = 75.9557
[sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 36.3636, 72.7273 )
[sub_resource type="RectangleShape2D" id=5]
extents = Vector2( 54.5455, 81.8182 )
[node name="Player1" type="KinematicBody2D"]
position = Vector2( 55.6483, 92.0135 )
scale = Vector2( 0.88, 0.88 )
script = ExtResource( 2 )
__meta__ = {
"_edit_group_": true
}
[node name="Health" type="Node" parent="."]
script = ExtResource( 3 )
[node name="Animated Sprite" type="AnimatedSprite" parent="."]
position = Vector2( -1.41425, 0 )
scale = Vector2( 0.547343, 0.547343 )
frames = ExtResource( 1 )
animation = "idle"
frame = 16
playing = true
__meta__ = {
"_edit_group_": true
}
[node name="ProgressBar" type="ProgressBar" parent="Animated Sprite"]
anchor_left = 0.5
anchor_right = 0.5
margin_left = -402.899
margin_top = -182.701
margin_right = -86.8986
margin_bottom = -148.701
custom_styles/fg = SubResource( 1 )
custom_styles/bg = SubResource( 2 )
value = 100.0
percent_visible = false
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Collision" type="CollisionShape2D" parent="."]
position = Vector2( 0, 10 )
shape = SubResource( 3 )
[node name="AttackArea" type="Area2D" parent="." groups=[
"melee_attack_p1",
]]
script = ExtResource( 4 )
[node name="AttackCollision" type="CollisionShape2D" parent="AttackArea"]
position = Vector2( 72.7273, 0 )
shape = SubResource( 4 )
disabled = true
[node name="ShoveAnimation" type="AnimatedSprite" parent="AttackArea/AttackCollision"]
position = Vector2( 29.4717, 4.74026 )
scale = Vector2( 1.5019, 1.5019 )
frames = ExtResource( 5 )
animation = "shove"
[node name="AttackDurationTimer" type="Timer" parent="."]
[node name="HitArea" type="Area2D" parent="." groups=[
"player1",
]]
[node name="HitBox" type="CollisionShape2D" parent="HitArea"]
shape = SubResource( 5 )
[node name="JumpSound" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 7 )
pitch_scale = 1.44
[node name="ShoveSound" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 6 )
pitch_scale = 0.65
[connection signal="depleted" from="Health" to="." method="_on_Health_depleted"]
[connection signal="animation_finished" from="AttackArea/AttackCollision/ShoveAnimation" to="." method="_on_AnimatedSprite_animation_finished"]
[connection signal="timeout" from="AttackDurationTimer" to="." method="_on_AttackDurationTimer_timeout"]
[connection signal="area_entered" from="HitArea" to="." method="_on_HitArea_area_entered"]