Danmaku system

This commit is contained in:
Marco 2025-02-05 19:41:49 +01:00
commit fdec052c16
38 changed files with 924 additions and 9 deletions

85
Scenes/Actors/Rumia.tscn Normal file
View file

@ -0,0 +1,85 @@
[gd_scene load_steps=12 format=3 uid="uid://d1rlw6ddpmrn8"]
[ext_resource type="Script" path="res://Scripts/Actors/Boss.cs" id="1_na4uq"]
[ext_resource type="Resource" uid="uid://ks6fypeil6gk" path="res://Resources/BossPhases/TestBoss1.tres" id="2_1rhf6"]
[ext_resource type="Texture2D" uid="uid://bcqgke6dthlrj" path="res://Sprites/Actors/Rumia.png" id="2_7k5gp"]
[ext_resource type="Script" path="res://Scripts/Components/ProximityPlayerDetection.cs" id="3_gka5j"]
[ext_resource type="PackedScene" uid="uid://crry0rgk7a8sm" path="res://Scenes/Weapons/BaseWeapon.tscn" id="4_xc6nm"]
[ext_resource type="PackedScene" uid="uid://cuixq5ex0j40h" path="res://Scenes/enemyBullet.tscn" id="5_g1p0m"]
[ext_resource type="Script" path="res://Scripts/Components/BulletSpawner.cs" id="7_2obh7"]
[sub_resource type="CircleShape2D" id="CircleShape2D_8gtts"]
radius = 7.0
[sub_resource type="CircleShape2D" id="CircleShape2D_cacb5"]
radius = 4.0
[sub_resource type="CircleShape2D" id="CircleShape2D_v711r"]
radius = 85.0529
[sub_resource type="RectangleShape2D" id="RectangleShape2D_m1rsg"]
size = Vector2(8, 12)
[node name="Rumia" type="CharacterBody2D" groups=["Destroyable"]]
collision_layer = 16
collision_mask = 9
script = ExtResource("1_na4uq")
Phases = Array[Resource]([ExtResource("2_1rhf6")])
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_7k5gp")
[node name="Damage_HitBox" type="CollisionShape2D" parent="."]
visible = false
shape = SubResource("CircleShape2D_8gtts")
[node name="RigidBody2D" type="RigidBody2D" parent="."]
collision_layer = 16
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"]
visible = false
position = Vector2(0, 5)
shape = SubResource("CircleShape2D_cacb5")
[node name="PlayerDetection" type="Area2D" parent="."]
visible = false
collision_layer = 16
collision_mask = 2
script = ExtResource("3_gka5j")
[node name="PlayerDetectionArea" type="CollisionShape2D" parent="PlayerDetection"]
shape = SubResource("CircleShape2D_v711r")
[node name="ShootTimer" type="Timer" parent="."]
wait_time = 0.4
one_shot = true
[node name="Weapon" parent="." instance=ExtResource("4_xc6nm")]
BulletScene = ExtResource("5_g1p0m")
BulletCapacity = 4
BulletSpeed = 50.0
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
target_desired_distance = 64.0
path_max_distance = 800.0
path_postprocessing = 1
avoidance_enabled = true
debug_enabled = true
debug_path_custom_color = Color(1, 0, 0, 1)
[node name="DamageHitbox" type="Area2D" parent="."]
collision_layer = 16
collision_mask = 9
[node name="CollisionShape2D" type="CollisionShape2D" parent="DamageHitbox"]
shape = SubResource("RectangleShape2D_m1rsg")
[node name="BulletSpawner" type="Node2D" parent="."]
script = ExtResource("7_2obh7")
BulletScene = ExtResource("5_g1p0m")
[connection signal="area_entered" from="PlayerDetection" to="PlayerDetection" method="_on_area_entered"]
[connection signal="area_exited" from="PlayerDetection" to="." method="_on_area_exited"]
[connection signal="velocity_computed" from="NavigationAgent2D" to="." method="_on_navigation_agent_2d_velocity_computed"]
[connection signal="area_entered" from="DamageHitbox" to="." method="_on_damage_hitbox_area_entered"]

View file

@ -1,6 +1,17 @@
[gd_scene load_steps=2 format=3 uid="uid://bu5fvatj2j08j"]
[gd_scene load_steps=4 format=3 uid="uid://bu5fvatj2j08j"]
[ext_resource type="Script" path="res://Scripts/GameManager.cs" id="1_paetl"]
[ext_resource type="PackedScene" uid="uid://d1rlw6ddpmrn8" path="res://Scenes/Actors/Rumia.tscn" id="2_47q21"]
[ext_resource type="PackedScene" uid="uid://bghghp5ep4w2j" path="res://Scenes/player.tscn" id="2_f17ts"]
[node name="BossTestArena" type="Node2D"]
[node name="GameScene" type="Node2D" node_paths=PackedStringArray("PlayerSpawnMarker")]
script = ExtResource("1_paetl")
PlayerTemplate = ExtResource("2_f17ts")
PlayerSpawnMarker = NodePath("PlayerStartPosition")
[node name="Rumia" parent="." instance=ExtResource("2_47q21")]
position = Vector2(163, 37)
Health = 40.0
[node name="PlayerStartPosition" type="Marker2D" parent="."]
position = Vector2(178, 115)

View file

@ -0,0 +1,30 @@
[gd_scene load_steps=4 format=3 uid="uid://dohakkayqj4w2"]
[ext_resource type="Script" path="res://Scripts/Bullet.cs" id="1_vg1kg"]
[ext_resource type="Texture2D" uid="uid://dmwi86k7hr8sl" path="res://Sprites/Bullets/small_bullet_green.png" id="2_divgu"]
[sub_resource type="CircleShape2D" id="CircleShape2D_jxptd"]
radius = 2.23607
[node name="Bullet" type="Area2D" groups=["bullets"]]
collision_layer = 128
collision_mask = 71
script = ExtResource("1_vg1kg")
Speed = 200.0
Owner = 2
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_divgu")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_jxptd")
[node name="Node2D" type="Node2D" parent="."]
editor_description = "Player Bullet"
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="_on_visible_on_screen_notifier_2d_screen_exited"]

View file

@ -0,0 +1,30 @@
[gd_scene load_steps=4 format=3 uid="uid://b0clsnefjsohc"]
[ext_resource type="Script" path="res://Scripts/Bullet.cs" id="1_w5w28"]
[ext_resource type="Texture2D" uid="uid://c4ijhpgbwmbr8" path="res://Sprites/Bullets/mid_bullet.png" id="2_5gscp"]
[sub_resource type="CircleShape2D" id="CircleShape2D_jxptd"]
radius = 4.0
[node name="Bullet" type="Area2D" groups=["bullets"]]
collision_layer = 128
collision_mask = 71
script = ExtResource("1_w5w28")
Speed = 200.0
Owner = 2
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_5gscp")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_jxptd")
[node name="Node2D" type="Node2D" parent="."]
editor_description = "Player Bullet"
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="_on_visible_on_screen_notifier_2d_screen_exited"]

View file

@ -0,0 +1,27 @@
[gd_scene load_steps=4 format=3 uid="uid://by2rk6gx67f7e"]
[ext_resource type="Script" path="res://Scripts/Bullet.cs" id="1_hd5v3"]
[ext_resource type="Texture2D" uid="uid://s5argltaljmq" path="res://Sprites/Bullets/small_bullet_yellow.png" id="2_c3vqu"]
[sub_resource type="CircleShape2D" id="CircleShape2D_jxptd"]
radius = 2.23607
[node name="Bullet" type="Area2D" groups=["bullets"]]
collision_layer = 128
collision_mask = 71
script = ExtResource("1_hd5v3")
Speed = 200.0
Owner = 2
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_c3vqu")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_jxptd")
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="_on_visible_on_screen_notifier_2d_screen_exited"]