mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-20 17:10:20 +02:00
Added more boss state machine
This commit is contained in:
@@ -21,26 +21,23 @@
|
|||||||
[ext_resource path="res://Boss/SlimeBoss/States/ReturnToCenter.gd" type="Script" id=19]
|
[ext_resource path="res://Boss/SlimeBoss/States/ReturnToCenter.gd" type="Script" id=19]
|
||||||
[ext_resource path="res://Boss/SlimeBoss/States/Stomp.gd" type="Script" id=20]
|
[ext_resource path="res://Boss/SlimeBoss/States/Stomp.gd" type="Script" id=20]
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id=15]
|
[sub_resource type="CircleShape2D" id=1]
|
||||||
radius = 60.0
|
radius = 60.0
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id=1]
|
[sub_resource type="CircleShape2D" id=17]
|
||||||
radius = 18.0
|
radius = 16.0312
|
||||||
height = 18.0
|
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id=2]
|
[sub_resource type="CircleShape2D" id=16]
|
||||||
radius = 18.0
|
radius = 24.0208
|
||||||
height = 18.0
|
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id=3]
|
[sub_resource type="CircleShape2D" id=4]
|
||||||
radius = 150.0
|
radius = 150.0
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id=4]
|
[sub_resource type="CapsuleShape2D" id=5]
|
||||||
radius = 8.0
|
radius = 8.0
|
||||||
height = 32.0
|
height = 32.0
|
||||||
|
|
||||||
[sub_resource type="Animation" id=5]
|
[sub_resource type="Animation" id=6]
|
||||||
resource_name = "ChargeDown"
|
|
||||||
length = 0.45
|
length = 0.45
|
||||||
step = 0.025
|
step = 0.025
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
@@ -116,8 +113,7 @@ tracks/5/keys = {
|
|||||||
"values": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]
|
"values": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id=6]
|
[sub_resource type="Animation" id=7]
|
||||||
resource_name = "ChargeLeft"
|
|
||||||
length = 0.45
|
length = 0.45
|
||||||
step = 0.025
|
step = 0.025
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
@@ -193,8 +189,7 @@ tracks/5/keys = {
|
|||||||
"values": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]
|
"values": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id=7]
|
[sub_resource type="Animation" id=8]
|
||||||
resource_name = "ChargeRight"
|
|
||||||
length = 0.45
|
length = 0.45
|
||||||
step = 0.025
|
step = 0.025
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
@@ -270,8 +265,7 @@ tracks/5/keys = {
|
|||||||
"values": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]
|
"values": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id=8]
|
[sub_resource type="Animation" id=9]
|
||||||
resource_name = "ChargeUp"
|
|
||||||
length = 0.45
|
length = 0.45
|
||||||
step = 0.025
|
step = 0.025
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
@@ -347,8 +341,7 @@ tracks/5/keys = {
|
|||||||
"values": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]
|
"values": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id=9]
|
[sub_resource type="Animation" id=10]
|
||||||
resource_name = "Charging"
|
|
||||||
length = 1.9
|
length = 1.9
|
||||||
step = 0.025
|
step = 0.025
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
@@ -424,7 +417,7 @@ tracks/5/keys = {
|
|||||||
"values": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ]
|
"values": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id=10]
|
[sub_resource type="Animation" id=11]
|
||||||
length = 1.9
|
length = 1.9
|
||||||
step = 0.025
|
step = 0.025
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
@@ -500,7 +493,7 @@ tracks/5/keys = {
|
|||||||
"values": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ]
|
"values": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id=11]
|
[sub_resource type="Animation" id=12]
|
||||||
length = 2.66666
|
length = 2.66666
|
||||||
step = 0.0111111
|
step = 0.0111111
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
@@ -576,7 +569,7 @@ tracks/5/keys = {
|
|||||||
"values": [ false ]
|
"values": [ false ]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id=12]
|
[sub_resource type="Animation" id=13]
|
||||||
length = 1.28333
|
length = 1.28333
|
||||||
step = 0.0166667
|
step = 0.0166667
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
@@ -652,7 +645,7 @@ tracks/5/keys = {
|
|||||||
"values": [ true ]
|
"values": [ true ]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id=13]
|
[sub_resource type="Animation" id=14]
|
||||||
length = 1.28333
|
length = 1.28333
|
||||||
step = 0.0166667
|
step = 0.0166667
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
@@ -728,7 +721,7 @@ tracks/5/keys = {
|
|||||||
"values": [ false ]
|
"values": [ false ]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id=14]
|
[sub_resource type="Animation" id=15]
|
||||||
length = 1.28333
|
length = 1.28333
|
||||||
step = 0.0166667
|
step = 0.0166667
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
@@ -806,7 +799,7 @@ tracks/5/keys = {
|
|||||||
|
|
||||||
[node name="SlimeBoss" type="KinematicBody2D"]
|
[node name="SlimeBoss" type="KinematicBody2D"]
|
||||||
collision_layer = 4
|
collision_layer = 4
|
||||||
collision_mask = 3
|
collision_mask = 2
|
||||||
script = ExtResource( 4 )
|
script = ExtResource( 4 )
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_group_": true
|
"_edit_group_": true
|
||||||
@@ -879,7 +872,7 @@ hframes = 11
|
|||||||
[node name="StompHitbox" parent="." instance=ExtResource( 2 )]
|
[node name="StompHitbox" parent="." instance=ExtResource( 2 )]
|
||||||
|
|
||||||
[node name="CollisionShape2D" parent="StompHitbox" index="0"]
|
[node name="CollisionShape2D" parent="StompHitbox" index="0"]
|
||||||
shape = SubResource( 15 )
|
shape = SubResource( 1 )
|
||||||
disabled = true
|
disabled = true
|
||||||
|
|
||||||
[node name="Hitbox" parent="." instance=ExtResource( 2 )]
|
[node name="Hitbox" parent="." instance=ExtResource( 2 )]
|
||||||
@@ -887,7 +880,7 @@ collision_layer = 4
|
|||||||
|
|
||||||
[node name="CollisionShape2D" parent="Hitbox" index="0"]
|
[node name="CollisionShape2D" parent="Hitbox" index="0"]
|
||||||
position = Vector2( 0, -15 )
|
position = Vector2( 0, -15 )
|
||||||
shape = SubResource( 1 )
|
shape = SubResource( 17 )
|
||||||
|
|
||||||
[node name="Hurtbox" parent="." instance=ExtResource( 1 )]
|
[node name="Hurtbox" parent="." instance=ExtResource( 1 )]
|
||||||
collision_layer = 4
|
collision_layer = 4
|
||||||
@@ -895,19 +888,19 @@ collision_mask = 0
|
|||||||
|
|
||||||
[node name="CollisionShape2D" parent="Hurtbox" index="0"]
|
[node name="CollisionShape2D" parent="Hurtbox" index="0"]
|
||||||
position = Vector2( 0, -15 )
|
position = Vector2( 0, -15 )
|
||||||
shape = SubResource( 2 )
|
shape = SubResource( 16 )
|
||||||
|
|
||||||
[node name="HeroCloseZone" type="Area2D" parent="."]
|
[node name="HeroCloseZone" type="Area2D" parent="."]
|
||||||
collision_layer = 0
|
collision_layer = 0
|
||||||
script = ExtResource( 14 )
|
script = ExtResource( 14 )
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="HeroCloseZone"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="HeroCloseZone"]
|
||||||
shape = SubResource( 3 )
|
shape = SubResource( 4 )
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
position = Vector2( -1.52588e-05, 0 )
|
position = Vector2( -1.52588e-05, 0 )
|
||||||
rotation = 1.5708
|
rotation = 1.5708
|
||||||
shape = SubResource( 4 )
|
shape = SubResource( 5 )
|
||||||
|
|
||||||
[node name="DebugLabel" type="Label" parent="."]
|
[node name="DebugLabel" type="Label" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
@@ -922,16 +915,16 @@ __meta__ = {
|
|||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
autoplay = "MoveRight"
|
autoplay = "MoveRight"
|
||||||
anims/ChargeDown = SubResource( 5 )
|
anims/ChargeDown = SubResource( 6 )
|
||||||
anims/ChargeLeft = SubResource( 6 )
|
anims/ChargeLeft = SubResource( 7 )
|
||||||
anims/ChargeRight = SubResource( 7 )
|
anims/ChargeRight = SubResource( 8 )
|
||||||
anims/ChargeUp = SubResource( 8 )
|
anims/ChargeUp = SubResource( 9 )
|
||||||
anims/Charging = SubResource( 9 )
|
anims/Charging = SubResource( 10 )
|
||||||
anims/FightStart = SubResource( 10 )
|
anims/FightStart = SubResource( 11 )
|
||||||
anims/MoveDown = SubResource( 11 )
|
anims/MoveDown = SubResource( 12 )
|
||||||
anims/MoveLeft = SubResource( 12 )
|
anims/MoveLeft = SubResource( 13 )
|
||||||
anims/MoveRight = SubResource( 13 )
|
anims/MoveRight = SubResource( 14 )
|
||||||
anims/MoveUp = SubResource( 14 )
|
anims/MoveUp = SubResource( 15 )
|
||||||
[connection signal="health_changed" from="Stats" to="." method="_on_Stats_health_changed"]
|
[connection signal="health_changed" from="Stats" to="." method="_on_Stats_health_changed"]
|
||||||
[connection signal="no_health" from="Stats" to="." method="_on_Stats_no_health"]
|
[connection signal="no_health" from="Stats" to="." method="_on_Stats_no_health"]
|
||||||
[connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"]
|
[connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"]
|
||||||
|
|||||||
@@ -96,14 +96,14 @@ func _decide_on_next_state():
|
|||||||
set_invincible(true)
|
set_invincible(true)
|
||||||
return $States/FightStart
|
return $States/FightStart
|
||||||
if state_active == $States/FightStart:
|
if state_active == $States/FightStart:
|
||||||
# set_invincible(false)
|
set_invincible(false)
|
||||||
return $States/ChargeSequence
|
return $States/ChargeSequence
|
||||||
|
|
||||||
if _phase == PHASES.PHASE_ONE:
|
if _phase == PHASES.PHASE_ONE:
|
||||||
if angry_phases_done < 1:
|
if angry_phases_done < 1:
|
||||||
set_invincible(true)
|
set_invincible(true)
|
||||||
sequence_cycles += 1
|
sequence_cycles += 1
|
||||||
if sequence_cycles < 4:
|
if sequence_cycles < 2:
|
||||||
return $States/ChargeSequence
|
return $States/ChargeSequence
|
||||||
else:
|
else:
|
||||||
angry_phases_done = 1
|
angry_phases_done = 1
|
||||||
@@ -116,7 +116,33 @@ func _decide_on_next_state():
|
|||||||
set_invincible(false)
|
set_invincible(false)
|
||||||
return $States/RoamSequence
|
return $States/RoamSequence
|
||||||
if state_active == $States/RoamSequence:
|
if state_active == $States/RoamSequence:
|
||||||
|
return $States/ChargeSequence
|
||||||
|
if state_active == $States/ChargeSequence:
|
||||||
|
return $States/Stomp
|
||||||
|
|
||||||
|
if _phase == PHASES.PHASE_TWO:
|
||||||
|
if angry_phases_done < 2:
|
||||||
|
set_invincible(true)
|
||||||
|
if sequence_cycles < 4:
|
||||||
|
if state_active == $States/ChargeSequence:
|
||||||
|
return $States/Stomp
|
||||||
|
if state_active == $States/Stomp:
|
||||||
|
sequence_cycles += 1
|
||||||
|
return $States/ChargeSequence
|
||||||
|
else:
|
||||||
|
angry_phases_done = 2
|
||||||
|
sequence_cycles = 0
|
||||||
|
return $States/ReturnToCenter
|
||||||
|
else:
|
||||||
|
if state_active == $States/ReturnToCenter:
|
||||||
|
return $States/Stomp # TODO: Maybe Stomp.
|
||||||
|
if state_active == $States/Stomp:
|
||||||
|
set_invincible(false)
|
||||||
return $States/RoamSequence
|
return $States/RoamSequence
|
||||||
|
if state_active == $States/RoamSequence:
|
||||||
|
return $States/ChargeSequence
|
||||||
|
if state_active == $States/ChargeSequence:
|
||||||
|
return $States/Stomp
|
||||||
|
|
||||||
# # Death
|
# # Death
|
||||||
# if state_active == $States/Die:
|
# if state_active == $States/Die:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ region_enabled = true
|
|||||||
region_rect = Rect2( 0, 0, 1280, 720 )
|
region_rect = Rect2( 0, 0, 1280, 720 )
|
||||||
|
|
||||||
[node name="Background" parent="." instance=ExtResource( 7 )]
|
[node name="Background" parent="." instance=ExtResource( 7 )]
|
||||||
frame = 5
|
frame = 40
|
||||||
|
|
||||||
[node name="FloorTileMap" type="TileMap" parent="."]
|
[node name="FloorTileMap" type="TileMap" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
|
|||||||
Reference in New Issue
Block a user