the boss!
This commit is contained in:
parent
1e618d8cd4
commit
abd45d7d64
14 changed files with 445 additions and 2 deletions
11
graphics/bullets/normal_bullet/test_bullet_strip.tres
Normal file
11
graphics/bullets/normal_bullet/test_bullet_strip.tres
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[gd_resource type="Resource" script_class="AnimationStrip" load_steps=3 format=3 uid="uid://d4nwqsr1tyguc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://0ognvvq2ncd7" path="res://systems/visuals/animation_strip.gd" id="1_s564h"]
|
||||
[ext_resource type="Texture2D" uid="uid://c21fe72aym3fe" path="res://graphics/bullets/normal_bullet/test_bullet.png" id="2_w8fao"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_s564h")
|
||||
texture = ExtResource("2_w8fao")
|
||||
frames = 2
|
||||
fps = 10.0
|
||||
metadata/_custom_type_script = "uid://0ognvvq2ncd7"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
[gd_resource type="Resource" script_class="AnimationStrip" load_steps=3 format=3 uid="uid://comjbd70kctg8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://0ognvvq2ncd7" path="res://systems/visuals/animation_strip.gd" id="1_8q4ym"]
|
||||
[ext_resource type="Texture2D" uid="uid://cgqgb84k38tbe" path="res://graphics/bullets/normal_bullet/test_bullet_overlay.png" id="2_mrles"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_8q4ym")
|
||||
texture = ExtResource("2_mrles")
|
||||
frames = 2
|
||||
fps = 10.0
|
||||
metadata/_custom_type_script = "uid://0ognvvq2ncd7"
|
||||
273
objects/bosses/tesu/tesu.tscn
Normal file
273
objects/bosses/tesu/tesu.tscn
Normal file
|
|
@ -0,0 +1,273 @@
|
|||
[gd_scene load_steps=34 format=3 uid="uid://bsgqhb8qak75u"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6ae108uhk7hk" path="res://systems/boss/boss.gd" id="1_8sblh"]
|
||||
[ext_resource type="Script" uid="uid://nyslrh651s8u" path="res://systems/boss/boss_phase.gd" id="2_vnn1v"]
|
||||
[ext_resource type="AudioStream" uid="uid://dwffpsx7xlfla" path="res://audio/sounds/boss_hit.ogg" id="3_vnhju"]
|
||||
[ext_resource type="Texture2D" uid="uid://y0c5cddwa216" path="res://graphics/boss_sprites/tesu.png" id="3_vnn1v"]
|
||||
[ext_resource type="Script" uid="uid://df8w64703kw0c" path="res://systems/bullets/danmaku_emitter.gd" id="4_duqw0"]
|
||||
[ext_resource type="Script" uid="uid://vus1a0flwtnm" path="res://systems/bullets/bullet_preset.gd" id="5_aka0y"]
|
||||
[ext_resource type="Resource" uid="uid://d4nwqsr1tyguc" path="res://graphics/bullets/normal_bullet/test_bullet_strip.tres" id="6_3hyls"]
|
||||
[ext_resource type="Script" uid="uid://0ognvvq2ncd7" path="res://systems/visuals/animation_strip.gd" id="6_aka0y"]
|
||||
[ext_resource type="Script" uid="uid://dntp60my5f65m" path="res://systems/bullets/bullet_behaviors/linear_motion_behavior.gd" id="7_vnhju"]
|
||||
[ext_resource type="Resource" uid="uid://comjbd70kctg8" path="res://graphics/bullets/normal_bullet/test_bullet_strip_overlay.tres" id="8_vnhju"]
|
||||
[ext_resource type="Script" uid="uid://dtuc6qerbfset" path="res://systems/bullets/spawn_patterns/ring_pattern.gd" id="9_3hyls"]
|
||||
[ext_resource type="Script" uid="uid://ckedfcjjnv7dq" path="res://systems/bullets/spawn_patterns/randomized_spawn_pattern.gd" id="10_7bpd6"]
|
||||
[ext_resource type="Script" uid="uid://t5lnmlng1vey" path="res://systems/bullets/spawn_patterns/spread_pattern.gd" id="13_7bpd6"]
|
||||
[ext_resource type="Script" uid="uid://drxrjgbmeglwp" path="res://systems/bullets/spawn_patterns/stacked_spawn_pattern.gd" id="14_jr3ht"]
|
||||
[ext_resource type="Script" uid="uid://b00hsbakgtsi0" path="res://systems/bullets/spawn_patterns/targetted_spawn_pattern.gd" id="15_hqscp"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_3hyls"]
|
||||
resource_name = "midway_left"
|
||||
length = 7.0
|
||||
loop_mode = 1
|
||||
step = 0.25
|
||||
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, 1, 2.5, 3, 4, 5, 6.5),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(120, 80), Vector2(40, 80), Vector2(40, 80), Vector2(120, 80), Vector2(120, 80), Vector2(200, 80), Vector2(200, 80)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_vnhju"]
|
||||
length = 0.001
|
||||
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),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(120, 80)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_16jkj"]
|
||||
resource_name = "pinch"
|
||||
length = 8.0
|
||||
loop_mode = 1
|
||||
step = 0.25
|
||||
capture_included = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 4),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 2,
|
||||
"values": [Vector2(40, 80), Vector2(200, 80)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_16jkj"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_vnhju"),
|
||||
&"midway_left": SubResource("Animation_3hyls"),
|
||||
&"pinch": SubResource("Animation_16jkj")
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_vnn1v"]
|
||||
size = Vector2(36, 36)
|
||||
|
||||
[sub_resource type="Resource" id="Resource_hqscp"]
|
||||
script = ExtResource("7_vnhju")
|
||||
metadata/_custom_type_script = "uid://dntp60my5f65m"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_vnhju"]
|
||||
script = ExtResource("9_3hyls")
|
||||
bullet_count = 1
|
||||
bullet_speed = 120.0
|
||||
metadata/_custom_type_script = "uid://dtuc6qerbfset"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_lp5hl"]
|
||||
script = ExtResource("10_7bpd6")
|
||||
pattern = SubResource("Resource_vnhju")
|
||||
property_min_values = Dictionary[StringName, float]({
|
||||
&"angle_offset": 0.0
|
||||
})
|
||||
property_max_values = Dictionary[StringName, float]({
|
||||
&"angle_offset": 6.283
|
||||
})
|
||||
iterations = 50
|
||||
metadata/_custom_type_script = "uid://ckedfcjjnv7dq"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_4tcmc"]
|
||||
script = ExtResource("5_aka0y")
|
||||
behavior = SubResource("Resource_hqscp")
|
||||
hitbox_size = Vector2i(6, 6)
|
||||
base_graphics = Array[ExtResource("6_aka0y")]([ExtResource("6_3hyls")])
|
||||
overlay_graphics = Array[ExtResource("6_aka0y")]([ExtResource("8_vnhju")])
|
||||
colors = Array[Color]([Color(1, 0, 0, 1), Color(0, 1, 0, 1), Color(0, 0, 1, 1), Color(1, 1, 0, 1)])
|
||||
pattern = SubResource("Resource_lp5hl")
|
||||
metadata/_custom_type_script = "uid://vus1a0flwtnm"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_16jkj"]
|
||||
script = ExtResource("7_vnhju")
|
||||
acceleration = 80.0
|
||||
metadata/_custom_type_script = "uid://dntp60my5f65m"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_3hyls"]
|
||||
script = ExtResource("9_3hyls")
|
||||
radius = 16.0
|
||||
direction_rotation = 3.6651914291880923
|
||||
metadata/_custom_type_script = "uid://dtuc6qerbfset"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_7bpd6"]
|
||||
script = ExtResource("10_7bpd6")
|
||||
pattern = SubResource("Resource_3hyls")
|
||||
property_min_values = Dictionary[StringName, float]({
|
||||
&"angle_offset": 0.0
|
||||
})
|
||||
property_max_values = Dictionary[StringName, float]({
|
||||
&"angle_offset": 6.283
|
||||
})
|
||||
iterations = 10
|
||||
metadata/_custom_type_script = "uid://ckedfcjjnv7dq"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_5v8uu"]
|
||||
script = ExtResource("5_aka0y")
|
||||
behavior = SubResource("Resource_16jkj")
|
||||
hitbox_size = Vector2i(6, 6)
|
||||
base_graphics = Array[ExtResource("6_aka0y")]([ExtResource("6_3hyls")])
|
||||
overlay_graphics = Array[ExtResource("6_aka0y")]([ExtResource("8_vnhju")])
|
||||
colors = Array[Color]([Color(1, 0, 1, 1), Color(0, 1, 1, 1), Color(1, 1, 1, 1)])
|
||||
pattern = SubResource("Resource_7bpd6")
|
||||
metadata/_custom_type_script = "uid://vus1a0flwtnm"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_jr3ht"]
|
||||
script = ExtResource("7_vnhju")
|
||||
metadata/_custom_type_script = "uid://dntp60my5f65m"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_vbmnr"]
|
||||
script = ExtResource("13_7bpd6")
|
||||
bullet_count = 3
|
||||
spread = 1.0471975511965976
|
||||
metadata/_custom_type_script = "uid://t5lnmlng1vey"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_wmp00"]
|
||||
script = ExtResource("14_jr3ht")
|
||||
pattern = SubResource("Resource_vbmnr")
|
||||
stack_count = 6
|
||||
min_speed = 60.0
|
||||
max_speed = 160.0
|
||||
metadata/_custom_type_script = "uid://drxrjgbmeglwp"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_fouyt"]
|
||||
script = ExtResource("15_hqscp")
|
||||
pattern = SubResource("Resource_wmp00")
|
||||
metadata/_custom_type_script = "uid://b00hsbakgtsi0"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_0243l"]
|
||||
script = ExtResource("5_aka0y")
|
||||
behavior = SubResource("Resource_jr3ht")
|
||||
hitbox_size = Vector2i(6, 6)
|
||||
base_graphics = Array[ExtResource("6_aka0y")]([ExtResource("6_3hyls")])
|
||||
overlay_graphics = Array[ExtResource("6_aka0y")]([ExtResource("8_vnhju")])
|
||||
colors = Array[Color]([Color(1, 0, 0, 1), Color(1, 1, 0, 1), Color(1, 0.49803922, 0, 1)])
|
||||
pattern = SubResource("Resource_fouyt")
|
||||
metadata/_custom_type_script = "uid://vus1a0flwtnm"
|
||||
|
||||
[node name="Tesu" type="Node2D" node_paths=PackedStringArray("first_phase")]
|
||||
script = ExtResource("1_8sblh")
|
||||
first_phase = NodePath("Phases/Still")
|
||||
metadata/_custom_type_script = "uid://b6ae108uhk7hk"
|
||||
|
||||
[node name="Phases" type="Node" parent="."]
|
||||
|
||||
[node name="Still" type="Node" parent="Phases" node_paths=PackedStringArray("next_phase")]
|
||||
script = ExtResource("2_vnn1v")
|
||||
hp = 200
|
||||
next_phase = NodePath("../MidwayLeft")
|
||||
metadata/_custom_type_script = "uid://nyslrh651s8u"
|
||||
|
||||
[node name="MidwayLeft" type="Node" parent="Phases" node_paths=PackedStringArray("next_phase")]
|
||||
script = ExtResource("2_vnn1v")
|
||||
hp = 100
|
||||
next_phase = NodePath("../Pinch")
|
||||
metadata/_custom_type_script = "uid://nyslrh651s8u"
|
||||
|
||||
[node name="Pinch" type="Node" parent="Phases"]
|
||||
script = ExtResource("2_vnn1v")
|
||||
hp = 100
|
||||
metadata/_custom_type_script = "uid://nyslrh651s8u"
|
||||
|
||||
[node name="Sounds" type="Node" parent="."]
|
||||
|
||||
[node name="HurtSound" type="AudioStreamPlayer" parent="Sounds"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("3_vnhju")
|
||||
max_polyphony = 8
|
||||
|
||||
[node name="Body" type="Node2D" parent="."]
|
||||
position = Vector2(120, 80)
|
||||
|
||||
[node name="Movements" type="AnimationPlayer" parent="Body"]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_16jkj")
|
||||
}
|
||||
blend_times = [&"midway_left", &"pinch", 2.0]
|
||||
|
||||
[node name="Graphic" type="Sprite2D" parent="Body"]
|
||||
texture = ExtResource("3_vnn1v")
|
||||
|
||||
[node name="PlayerBulletDetector" type="Area2D" parent="Body"]
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Body/PlayerBulletDetector"]
|
||||
shape = SubResource("RectangleShape2D_vnn1v")
|
||||
|
||||
[node name="BasicRandomSpread" type="Node2D" parent="Body" node_paths=PackedStringArray("spawn_parent")]
|
||||
script = ExtResource("4_duqw0")
|
||||
spawn_parent = NodePath("../../Bullets")
|
||||
preset = SubResource("Resource_4tcmc")
|
||||
metadata/_custom_type_script = "uid://df8w64703kw0c"
|
||||
|
||||
[node name="SpawnRandomBasic" type="Timer" parent="Body/BasicRandomSpread"]
|
||||
process_callback = 0
|
||||
wait_time = 0.5
|
||||
|
||||
[node name="MidwayMadness" type="Node2D" parent="Body" node_paths=PackedStringArray("spawn_parent")]
|
||||
script = ExtResource("4_duqw0")
|
||||
spawn_parent = NodePath("../../Bullets")
|
||||
preset = SubResource("Resource_5v8uu")
|
||||
metadata/_custom_type_script = "uid://df8w64703kw0c"
|
||||
|
||||
[node name="SpawnMidwayMadness" type="Timer" parent="Body/MidwayMadness"]
|
||||
process_callback = 0
|
||||
wait_time = 0.5
|
||||
|
||||
[node name="Pinch" type="Node2D" parent="Body" node_paths=PackedStringArray("spawn_parent")]
|
||||
script = ExtResource("4_duqw0")
|
||||
spawn_parent = NodePath("../../Bullets")
|
||||
preset = SubResource("Resource_0243l")
|
||||
metadata/_custom_type_script = "uid://df8w64703kw0c"
|
||||
|
||||
[node name="SpawnPinch" type="Timer" parent="Body/Pinch"]
|
||||
process_callback = 0
|
||||
wait_time = 0.75
|
||||
|
||||
[node name="Bullets" type="Node2D" parent="."]
|
||||
|
||||
[connection signal="damaged" from="." to="Sounds/HurtSound" method="play" unbinds=1]
|
||||
[connection signal="ended" from="Phases/Still" to="Body/BasicRandomSpread/SpawnRandomBasic" method="stop"]
|
||||
[connection signal="started" from="Phases/Still" to="Body/BasicRandomSpread/SpawnRandomBasic" method="start"]
|
||||
[connection signal="ended" from="Phases/MidwayLeft" to="Body/MidwayMadness/SpawnMidwayMadness" method="stop"]
|
||||
[connection signal="started" from="Phases/MidwayLeft" to="Body/MidwayMadness/SpawnMidwayMadness" method="start"]
|
||||
[connection signal="started" from="Phases/MidwayLeft" to="Body/Movements" method="play" binds= [&"midway_left"]]
|
||||
[connection signal="started" from="Phases/Pinch" to="Body/Pinch/SpawnPinch" method="start"]
|
||||
[connection signal="started" from="Phases/Pinch" to="Body/Movements" method="play" binds= [&"pinch"]]
|
||||
[connection signal="area_entered" from="Body/PlayerBulletDetector" to="." method="hurt" unbinds=1]
|
||||
[connection signal="timeout" from="Body/BasicRandomSpread/SpawnRandomBasic" to="Body/BasicRandomSpread" method="spawn_preset"]
|
||||
[connection signal="timeout" from="Body/MidwayMadness/SpawnMidwayMadness" to="Body/MidwayMadness" method="spawn_preset"]
|
||||
[connection signal="timeout" from="Body/Pinch/SpawnPinch" to="Body/Pinch" method="spawn_preset"]
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=14 format=3 uid="uid://b1rm2x7lofhkm"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cv578r7dikm6r" path="res://objects/bosses/tesu.gd" id="1_aikw2"]
|
||||
[ext_resource type="Script" uid="uid://cv578r7dikm6r" path="res://objects/bosses/tesu_old.gd" id="1_aikw2"]
|
||||
[ext_resource type="Texture2D" uid="uid://y0c5cddwa216" path="res://graphics/boss_sprites/tesu.png" id="1_h31ol"]
|
||||
[ext_resource type="AudioStream" uid="uid://dwffpsx7xlfla" path="res://audio/sounds/boss_hit.ogg" id="3_aikw2"]
|
||||
[ext_resource type="PackedScene" uid="uid://cciq2vk8sex8w" path="res://objects/bullet_emitter/test_bullet_emitter.tscn" id="4_jhpyq"]
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
[ext_resource type="PackedScene" uid="uid://q2fys6o0jy6w" path="res://objects/starfield/starfield.tscn" id="1_gl3rp"]
|
||||
[ext_resource type="Texture2D" uid="uid://cokpdf3gw10kr" path="res://space.png" id="2_nv70j"]
|
||||
[ext_resource type="PackedScene" uid="uid://c714s5d7d5765" path="res://objects/player/player.tscn" id="3_fyu15"]
|
||||
[ext_resource type="PackedScene" uid="uid://b1rm2x7lofhkm" path="res://objects/bosses/tesu.tscn" id="4_0cr18"]
|
||||
[ext_resource type="PackedScene" uid="uid://b1rm2x7lofhkm" path="res://objects/bosses/tesu_old.tscn" id="4_0cr18"]
|
||||
[ext_resource type="AudioStream" uid="uid://dftw8ufcgjbft" path="res://audio/music/04 - Stage 2 (Purple Sea).mp3" id="5_yu621"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ikr60"]
|
||||
|
|
|
|||
30
scenes/new_vslice.tscn
Normal file
30
scenes/new_vslice.tscn
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://cvuaxqqm3sfiw"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://q2fys6o0jy6w" path="res://objects/starfield/starfield.tscn" id="1_2jclk"]
|
||||
[ext_resource type="PackedScene" uid="uid://c714s5d7d5765" path="res://objects/player/player.tscn" id="2_gadir"]
|
||||
[ext_resource type="AudioStream" uid="uid://dftw8ufcgjbft" path="res://audio/music/04 - Stage 2 (Purple Sea).mp3" id="2_oxyio"]
|
||||
[ext_resource type="PackedScene" uid="uid://bsgqhb8qak75u" path="res://objects/bosses/tesu/tesu.tscn" id="3_i608b"]
|
||||
|
||||
[node name="TestScene" type="Node"]
|
||||
|
||||
[node name="Background" type="CanvasLayer" parent="."]
|
||||
layer = -10
|
||||
|
||||
[node name="Starfield" type="SubViewportContainer" parent="Background"]
|
||||
offset_right = 240.0
|
||||
offset_bottom = 320.0
|
||||
|
||||
[node name="SubViewport" parent="Background/Starfield" instance=ExtResource("1_2jclk")]
|
||||
size = Vector2i(240, 320)
|
||||
|
||||
[node name="Music" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("2_oxyio")
|
||||
autoplay = true
|
||||
parameters/looping = true
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("2_gadir")]
|
||||
position = Vector2(122, 283)
|
||||
|
||||
[node name="Tesu" parent="." instance=ExtResource("3_i608b")]
|
||||
|
||||
[connection signal="defeated" from="Tesu" to="Tesu" method="queue_free"]
|
||||
34
systems/boss/boss.gd
Normal file
34
systems/boss/boss.gd
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
class_name Boss
|
||||
extends Node2D
|
||||
|
||||
|
||||
signal damaged(damage: int)
|
||||
signal defeated()
|
||||
|
||||
|
||||
@export var first_phase: BossPhase
|
||||
|
||||
|
||||
var current_phase: BossPhase
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if first_phase:
|
||||
current_phase = first_phase
|
||||
current_phase.ended.connect(_on_phase_ended, CONNECT_ONE_SHOT)
|
||||
first_phase.start_phase()
|
||||
|
||||
|
||||
func hurt(damage: int = 1) -> void:
|
||||
if current_phase:
|
||||
CurrentGame.change_score(100)
|
||||
current_phase.hurt(damage)
|
||||
damaged.emit(damage)
|
||||
|
||||
|
||||
func _on_phase_ended() -> void:
|
||||
current_phase = current_phase.next_phase
|
||||
if current_phase:
|
||||
current_phase.ended.connect(_on_phase_ended, CONNECT_ONE_SHOT)
|
||||
else:
|
||||
defeated.emit()
|
||||
1
systems/boss/boss.gd.uid
Normal file
1
systems/boss/boss.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b6ae108uhk7hk
|
||||
62
systems/boss/boss_phase.gd
Normal file
62
systems/boss/boss_phase.gd
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
class_name BossPhase
|
||||
extends Node
|
||||
|
||||
|
||||
signal started()
|
||||
signal ended()
|
||||
signal damaged(damage: int)
|
||||
|
||||
|
||||
## Amount of HP this boss stage has. If 0, the boss is invulnerable during
|
||||
## this phase and must survive until time runs out or [method end_phase] is called.
|
||||
@export_range(0, 1, 1, "or_greater") var hp: int = 0
|
||||
## "Survival Time" of the phase. The phase will end when time is up, whether
|
||||
## HP has been depleted or not.
|
||||
@export_range(0.0, 1.0, 0.01, "or_greater", "suffix:s") var time: float = INF
|
||||
|
||||
## The phase to automatically proceed to when this phase ends.
|
||||
@export var next_phase: BossPhase
|
||||
|
||||
|
||||
## [code]true[/code] if the phase is currently active.
|
||||
var active: bool = false
|
||||
|
||||
|
||||
var hp_left: int:
|
||||
set(value):
|
||||
hp_left = value
|
||||
if active and hp_left <= 0 and hp > 0:
|
||||
end_phase()
|
||||
|
||||
var time_left: float = INF:
|
||||
set(value):
|
||||
time_left = value
|
||||
if active and time_left <= 0.0:
|
||||
end_phase()
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if active:
|
||||
time_left -= delta
|
||||
|
||||
|
||||
func start_phase() -> void:
|
||||
if not active:
|
||||
hp_left = hp
|
||||
time_left = time
|
||||
active = true
|
||||
started.emit()
|
||||
|
||||
|
||||
func end_phase() -> void:
|
||||
if active:
|
||||
active = false
|
||||
ended.emit()
|
||||
if next_phase:
|
||||
next_phase.start_phase()
|
||||
|
||||
|
||||
func hurt(damage: int) -> void:
|
||||
if active:
|
||||
hp_left = maxi(0, hp_left - damage)
|
||||
damaged.emit(damage)
|
||||
1
systems/boss/boss_phase.gd.uid
Normal file
1
systems/boss/boss_phase.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://nyslrh651s8u
|
||||
19
systems/bullets/danmaku_emitter.gd
Normal file
19
systems/bullets/danmaku_emitter.gd
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
class_name DanmakuEmitter
|
||||
extends Node2D
|
||||
|
||||
|
||||
@export var spawn_parent: Node2D
|
||||
@export var preset: BulletPreset
|
||||
|
||||
|
||||
func spawn_preset() -> void:
|
||||
var bullet_set = BulletSet.new()
|
||||
bullet_set.preset = preset
|
||||
bullet_set.global_position = global_position
|
||||
bullet_set.global_rotation = global_rotation
|
||||
spawn_parent.add_child(bullet_set)
|
||||
|
||||
|
||||
func clear_bullets() -> void:
|
||||
for child in spawn_parent.get_children():
|
||||
child.queue_free()
|
||||
1
systems/bullets/danmaku_emitter.gd.uid
Normal file
1
systems/bullets/danmaku_emitter.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://df8w64703kw0c
|
||||
Loading…
Add table
Add a link
Reference in a new issue