Boss healthbar

This commit is contained in:
2023-09-03 00:16:40 -07:00
parent 7764644b90
commit cf2642be2c
29 changed files with 301 additions and 167 deletions

6
Scenes/HPComponent.tscn Normal file
View File

@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://b1j0g6ikmnibm"]
[ext_resource type="Script" path="res://Scripts/HealthPoints.cs" id="1_ocdf1"]
[node name="HP Component" type="Node"]
script = ExtResource("1_ocdf1")

View File

@@ -1,3 +1,3 @@
[gd_scene format=3 uid="uid://brfy0kmqf53e8"]
[gd_scene format=3 uid="uid://cf263gvuap16n"]
[node name="Level2" type="Node3D"]

View File

@@ -1,11 +1,7 @@
[gd_scene load_steps=11 format=3 uid="uid://dqv03pua4j8ga"]
[gd_scene load_steps=7 format=3 uid="uid://dqv03pua4j8ga"]
[ext_resource type="Script" path="res://Scripts/AreaExit.cs" id="1_owv8t"]
[ext_resource type="PackedScene" uid="uid://c0lv8ovqkl3a6" path="res://Levels/Models/STAGE 1.blend" id="1_pwpof"]
[ext_resource type="PackedScene" uid="uid://b38hcomu4tpm5" path="res://Scenes/TestCharacter.tscn" id="3_vd8bl"]
[ext_resource type="PackedScene" uid="uid://si4byubqnng4" path="res://Scenes/TestBullet.tscn" id="4_usx8k"]
[ext_resource type="PackedScene" uid="uid://bq40xbqibrk1y" path="res://Scenes/ShotgunBullet.tscn" id="5_yyoa6"]
[ext_resource type="Script" path="res://Scenes/Player2.cs" id="6_eyfbh"]
[ext_resource type="PackedScene" uid="uid://jgf7k1r35km1" path="res://Scenes/ExitPortal.tscn" id="6_gegi6"]
[ext_resource type="Script" path="res://Scripts/P1SpawnPoint.cs" id="8_43upo"]
[ext_resource type="Script" path="res://Scripts/P2SpawnPoint.cs" id="9_8v1uu"]
@@ -13,35 +9,11 @@
[sub_resource type="CylinderShape3D" id="CylinderShape3D_kv6vl"]
radius = 0.957319
[node name="Level1" type="Node3D"]
[node name="Level1" type="Node3D" groups=["Level"]]
script = ExtResource("1_owv8t")
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.496974, 0.867765, 0, -0.867765, 0.496974, -0.378925, 21.2932, 13.0512)
projection = 1
fov = 30.0
size = 9.0
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.929007, 0.136193, 0.34409, 0.369825, 0.375014, 0.850056, -0.0132668, 0.91696, -0.398758, -3.58319, 11.9025, 0.163277)
[node name="STAGE 1" parent="." instance=ExtResource("1_pwpof")]
[node name="Player1" parent="." groups=["Player1"] instance=ExtResource("3_vd8bl")]
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, -2.05794, 0, 5.4546)
collision_layer = 17
collision_mask = 17
_fireProjectile = ExtResource("4_usx8k")
_altFireProjectile = ExtResource("5_yyoa6")
[node name="Player2" parent="." groups=["Player2"] instance=ExtResource("3_vd8bl")]
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0.915219, 0, 5.4546)
collision_layer = 17
collision_mask = 17
script = ExtResource("6_eyfbh")
_fireProjectile = ExtResource("4_usx8k")
_altFireProjectile = ExtResource("5_yyoa6")
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]
collision_layer = 0
collision_mask = 16

View File

@@ -13,16 +13,6 @@ radius = 0.957319
script = ExtResource("1_u04pt")
_levelIndex = 1
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.496974, 0.867765, 0, -0.867765, 0.496974, -0.378925, 11.1744, 5.15227)
projection = 1
fov = 30.0
size = 8.0
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.931845, -0.0850834, 0.35274, -0.0909281, 0.995857, 1.46654e-08, -0.351279, -0.032074, -0.935721, -3.58319, 22.5795, 0.163277)
visible = false
[node name="STAGE 2" parent="." instance=ExtResource("1_5pcmj")]
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]

View File

@@ -13,16 +13,6 @@ radius = 0.957319
script = ExtResource("1_1tnw5")
_levelIndex = 2
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.496974, 0.867765, 0, -0.867765, 0.496974, -0.378925, 11.1744, 5.15227)
projection = 1
fov = 30.0
size = 8.0
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.931845, -0.0850834, 0.35274, -0.0909281, 0.995857, 1.46654e-08, -0.351279, -0.032074, -0.935721, -3.58319, 22.5795, 0.163277)
visible = false
[node name="STAGE 3" parent="." instance=ExtResource("1_blsh8")]
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]

View File

@@ -13,16 +13,6 @@ radius = 0.957319
script = ExtResource("1_sqfsi")
_levelIndex = 3
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.496974, 0.867765, 0, -0.867765, 0.496974, -0.378925, 11.1744, 5.15227)
projection = 1
fov = 30.0
size = 8.0
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.931845, -0.0850834, 0.35274, -0.0909281, 0.995857, 1.46654e-08, -0.351279, -0.032074, -0.935721, -3.58319, 22.5795, 0.163277)
visible = false
[node name="STAGE 4" parent="." instance=ExtResource("1_qu6ym")]
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]

View File

@@ -13,16 +13,6 @@ radius = 0.957319
script = ExtResource("1_qbafj")
_levelIndex = 4
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.496974, 0.867765, 0, -0.867765, 0.496974, -0.378925, 11.1744, 5.15227)
projection = 1
fov = 30.0
size = 8.0
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.931845, -0.0850834, 0.35274, -0.0909281, 0.995857, 1.46654e-08, -0.351279, -0.032074, -0.935721, -3.58319, 22.5795, 0.163277)
visible = false
[node name="STAGE 5" parent="." instance=ExtResource("1_fagdb")]
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]

View File

@@ -13,16 +13,6 @@ radius = 0.957319
script = ExtResource("1_qlv44")
_levelIndex = 5
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.496974, 0.867765, 0, -0.867765, 0.496974, -0.378925, 11.1744, 5.15227)
projection = 1
fov = 30.0
size = 8.0
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.931845, -0.0850834, 0.35274, -0.0909281, 0.995857, 1.46654e-08, -0.351279, -0.032074, -0.935721, -3.58319, 22.5795, 0.163277)
visible = false
[node name="STAGE 6" parent="." instance=ExtResource("1_q1cka")]
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]

View File

@@ -13,16 +13,6 @@ radius = 0.957319
script = ExtResource("1_fio4n")
_levelIndex = 6
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.496974, 0.867765, 0, -0.867765, 0.496974, -0.378925, 11.1744, 5.15227)
projection = 1
fov = 30.0
size = 8.0
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.931845, -0.0850834, 0.35274, -0.0909281, 0.995857, 1.46654e-08, -0.351279, -0.032074, -0.935721, -3.58319, 22.5795, 0.163277)
visible = false
[node name="STAGE 7" parent="." instance=ExtResource("1_dc67b")]
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]

View File

@@ -13,16 +13,6 @@ radius = 0.957319
script = ExtResource("1_mo03n")
_levelIndex = 7
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.496974, 0.867765, 0, -0.867765, 0.496974, -0.378925, 11.1744, 5.15227)
projection = 1
fov = 30.0
size = 8.0
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.931845, -0.0850834, 0.35274, -0.0909281, 0.995857, 1.46654e-08, -0.351279, -0.032074, -0.935721, -3.58319, 22.5795, 0.163277)
visible = false
[node name="STAGE 8" parent="." instance=ExtResource("1_wd00s")]
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]

View File

@@ -1,20 +1,60 @@
[gd_scene load_steps=4 format=3 uid="uid://0hdnmilwrsq6"]
[gd_scene load_steps=10 format=3 uid="uid://0hdnmilwrsq6"]
[ext_resource type="PackedScene" uid="uid://bs8iqbayeqqm" path="res://Levels/Models/STAGE 9.blend" id="1_ley6w"]
[ext_resource type="Script" path="res://Scripts/HealthbarProgress.cs" id="2_53ar2"]
[ext_resource type="Script" path="res://Scripts/P1SpawnPoint.cs" id="2_hr1h4"]
[ext_resource type="Script" path="res://Scripts/P2SpawnPoint.cs" id="3_xr71f"]
[ext_resource type="PackedScene" uid="uid://brbshysbgd47q" path="res://Scenes/god_circuit.tscn" id="4_vmhpd"]
[ext_resource type="Texture2D" uid="uid://ccnmmyvs53gni" path="res://Textures/Style_1.png" id="5_jjg8p"]
[ext_resource type="PackedScene" uid="uid://b1j0g6ikmnibm" path="res://Scenes/HPComponent.tscn" id="7_nvq88"]
[sub_resource type="LabelSettings" id="LabelSettings_8edkl"]
font_color = Color(0, 0, 0, 1)
[sub_resource type="BoxShape3D" id="BoxShape3D_slhvd"]
size = Vector3(2.65272, 5.04315, 1.02395)
[node name="Level9" type="Node3D" groups=["Level"]]
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.496974, 0.867765, 0, -0.867765, 0.496974, -0.378925, 11.1744, 5.15227)
projection = 1
fov = 30.0
size = 8.0
[node name="Control" type="Control" parent="."]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.931845, -0.0850834, 0.35274, -0.0909281, 0.995857, 1.46654e-08, -0.351279, -0.032074, -0.935721, -3.58319, 22.5795, 0.163277)
visible = false
[node name="TextureProgressBar" type="TextureProgressBar" parent="Control"]
top_level = true
z_index = 1
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_left = 4.0
offset_top = 44.0
offset_right = 4.0
offset_bottom = 73.0
grow_horizontal = 2
max_value = 2e+09
value = 2e+09
nine_patch_stretch = true
texture_progress = ExtResource("5_jjg8p")
script = ExtResource("2_53ar2")
[node name="Label" type="Label" parent="Control"]
top_level = true
z_index = 1
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -43.0
offset_right = 43.0
offset_bottom = 26.0
grow_horizontal = 2
text = "God Circuit
"
label_settings = SubResource("LabelSettings_8edkl")
[node name="STAGE 9" parent="." instance=ExtResource("1_ley6w")]
@@ -25,3 +65,20 @@ script = ExtResource("2_hr1h4")
[node name="P2_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.29148, 0.123258, 5.44653)
script = ExtResource("3_xr71f")
[node name="God Circuit" parent="." instance=ExtResource("4_vmhpd")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.54956, 1.08022, -0.0539055)
[node name="Area3D" type="Area3D" parent="God Circuit"]
collision_layer = 0
collision_mask = 2
[node name="CollisionShape3D" type="CollisionShape3D" parent="God Circuit/Area3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.89871, 1.49756, -2.3792)
shape = SubResource("BoxShape3D_slhvd")
[node name="HP Component" parent="God Circuit" node_paths=PackedStringArray("_healthBar") instance=ExtResource("7_nvq88")]
MaximumHP = 2000000000
_healthBar = NodePath("../../Control/TextureProgressBar")
[connection signal="body_entered" from="God Circuit/Area3D" to="God Circuit" method="OnHit"]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=3 uid="uid://vwrw05ob2caq"]
[gd_scene load_steps=17 format=3 uid="uid://vwrw05ob2caq"]
[ext_resource type="Script" path="res://Scripts/Main.cs" id="1_g4hua"]
[ext_resource type="PackedScene" uid="uid://dqv03pua4j8ga" path="res://Scenes/Levels/Level1.tscn" id="2_cqnvi"]
@@ -11,9 +11,40 @@
[ext_resource type="PackedScene" uid="uid://bsq7edeueqyjg" path="res://Scenes/Levels/Level7.tscn" id="8_407wt"]
[ext_resource type="PackedScene" uid="uid://c4xcka4ekuur8" path="res://Scenes/Levels/Level8.tscn" id="9_q0hjs"]
[ext_resource type="PackedScene" uid="uid://0hdnmilwrsq6" path="res://Scenes/Levels/Level9.tscn" id="10_imcyj"]
[ext_resource type="PackedScene" uid="uid://b38hcomu4tpm5" path="res://Scenes/TestCharacter.tscn" id="12_jopfo"]
[ext_resource type="PackedScene" uid="uid://si4byubqnng4" path="res://Scenes/TestBullet.tscn" id="13_3mmxc"]
[ext_resource type="PackedScene" uid="uid://bq40xbqibrk1y" path="res://Scenes/ShotgunBullet.tscn" id="14_32wp5"]
[ext_resource type="Script" path="res://Scenes/Player2.cs" id="15_0cpy3"]
[ext_resource type="PackedScene" uid="uid://dq1gtd55p04do" path="res://Scenes/StageGUI.tscn" id="16_imn5y"]
[node name="Main" type="Node"]
script = ExtResource("1_g4hua")
Levels = Array[PackedScene]([ExtResource("2_cqnvi"), ExtResource("3_2qwg5"), ExtResource("4_8bgmu"), ExtResource("5_6rnhl"), ExtResource("6_krvi4"), ExtResource("7_or04k"), ExtResource("8_407wt"), ExtResource("9_q0hjs"), ExtResource("10_imcyj")])
[node name="MainMenu" parent="." instance=ExtResource("2_kvovw")]
[node name="Player1" parent="." groups=["Player1"] instance=ExtResource("12_jopfo")]
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, -2.05794, 0, 5.4546)
collision_layer = 17
collision_mask = 17
_fireProjectile = ExtResource("13_3mmxc")
_altFireProjectile = ExtResource("14_32wp5")
[node name="Player2" parent="." groups=["Player2"] instance=ExtResource("12_jopfo")]
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0.915219, 0, 5.4546)
collision_layer = 17
collision_mask = 17
script = ExtResource("15_0cpy3")
_fireProjectile = ExtResource("13_3mmxc")
_altFireProjectile = ExtResource("14_32wp5")
[node name="StageGUI" parent="." instance=ExtResource("16_imn5y")]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.929007, 0.136193, 0.34409, 0.369825, 0.375014, 0.850056, -0.0132668, 0.91696, -0.398758, -3.58319, 11.9025, 0.163277)
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.496974, 0.867765, 0, -0.867765, 0.496974, -0.536318, 21.2932, 12.4591)
projection = 1
fov = 30.0
size = 10.5

View File

@@ -7,6 +7,8 @@
script = ExtResource("1_6aikc")
[node name="Control" type="Control" parent="."]
visible = false
z_index = 10
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0

View File

@@ -57,7 +57,7 @@ public partial class Player2 : CharacterBody3D
private async void Fire()
{
var projectile = _fireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, -3f);
projectile.Position = Position + new Vector3(0f, 1f, -1f);
GetParent().AddChild(projectile);
CanShoot = false;
await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout");
@@ -67,7 +67,7 @@ public partial class Player2 : CharacterBody3D
private async void AltFire()
{
var projectile = _altFireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, -3f);
projectile.Position = Position + new Vector3(0f, 1f, -1f);
GetParent().AddChild(projectile);
CanShoot = false;
await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout");

View File

@@ -1,16 +1,10 @@
[gd_scene load_steps=6 format=3 uid="uid://bq40xbqibrk1y"]
[gd_scene load_steps=4 format=3 uid="uid://bq40xbqibrk1y"]
[ext_resource type="Script" path="res://Scripts/ShotgunBullet.cs" id="1_binxs"]
[ext_resource type="Texture2D" uid="uid://borp7xvlfdcmq" path="res://Textures/Projectiles/bubble.png" id="2_dv80m"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_5vpcx"]
albedo_color = Color(0.584314, 0.0352941, 0.141176, 1)
[sub_resource type="SphereMesh" id="SphereMesh_ugmuv"]
material = SubResource("StandardMaterial3D_5vpcx")
[sub_resource type="SphereShape3D" id="SphereShape3D_o6kys"]
radius = 0.8
radius = 0.2
[node name="ShotgunBullet" type="Node3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.73894, 0)
@@ -19,72 +13,58 @@ Cooldown = 0.5
_projectileSpeed = 15.0
[node name="RigidBody3D" type="RigidBody3D" parent="."]
transform = Transform3D(0.999848, 0, -0.0174524, 0, 1, 0, 0.0174524, 0, 0.999848, -1.27456, 0, 0)
collision_layer = 2
collision_mask = 0
transform = Transform3D(0.99863, 0, -0.052336, 0, 1, 0, 0.052336, 0, 0.99863, -0.508974, 0, 0)
collision_layer = 34
collision_mask = 32
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 10
max_contacts_reported = 1000
contact_monitor = true
can_sleep = false
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidBody3D"]
transform = Transform3D(0.647894, 0, 0.761731, 0, 1, 0, -0.761731, 0, 0.647894, 0, 0, 0)
visible = false
mesh = SubResource("SphereMesh_ugmuv")
skeleton = NodePath("../..")
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
shape = SubResource("SphereShape3D_o6kys")
[node name="Sprite3D" type="Sprite3D" parent="RigidBody3D"]
pixel_size = 0.05
axis = 1
texture = ExtResource("2_dv80m")
[node name="RigidBody3D2" type="RigidBody3D" parent="."]
transform = Transform3D(0.999848, 0, 0.0174524, 0, 1, 0, -0.0174524, 0, 0.999848, 1.32, 0, 0)
collision_layer = 2
collision_mask = 0
transform = Transform3D(0.99863, 0, 0.052336, 0, 1, 0, -0.052336, 0, 0.99863, 0.647, 0, 0)
collision_layer = 34
collision_mask = 32
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 10
max_contacts_reported = 1000
contact_monitor = true
can_sleep = false
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidBody3D2"]
visible = false
mesh = SubResource("SphereMesh_ugmuv")
skeleton = NodePath("../..")
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D2"]
shape = SubResource("SphereShape3D_o6kys")
[node name="Sprite3D" type="Sprite3D" parent="RigidBody3D2"]
pixel_size = 0.05
axis = 1
texture = ExtResource("2_dv80m")
[node name="RigidBody3D3" type="RigidBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.56619)
collision_layer = 2
collision_mask = 0
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.592052)
collision_layer = 34
collision_mask = 32
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 10
max_contacts_reported = 1000
contact_monitor = true
can_sleep = false
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidBody3D3"]
transform = Transform3D(0.999848, 0, 0.0174524, 0, 1, 0, -0.0174524, 0, 0.999848, 0, 0, 0)
visible = false
mesh = SubResource("SphereMesh_ugmuv")
skeleton = NodePath("../..")
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D3"]
shape = SubResource("SphereShape3D_o6kys")
[node name="Sprite3D" type="Sprite3D" parent="RigidBody3D3"]
pixel_size = 0.05
axis = 1
texture = ExtResource("2_dv80m")
[node name="TTL" type="Timer" parent="."]
process_callback = 0
autostart = true
[connection signal="timeout" from="TTL" to="." method="OnTimeToLiveTimeout"]

36
Scenes/StageGUI.tscn Normal file
View File

@@ -0,0 +1,36 @@
[gd_scene format=3 uid="uid://dq1gtd55p04do"]
[node name="StageGUI" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Placeholder1" type="ColorRect" parent="."]
custom_minimum_size = Vector2(410, 1080)
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -540.0
offset_right = 240.0
offset_bottom = 540.0
grow_vertical = 2
color = Color(1, 0.447059, 1, 1)
[node name="Placeholder2" type="ColorRect" parent="."]
custom_minimum_size = Vector2(410, 1080)
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -300.0
offset_top = -540.0
offset_bottom = 540.0
grow_horizontal = 0
grow_vertical = 2
color = Color(1, 0.447059, 1, 1)

View File

@@ -10,7 +10,7 @@ albedo_color = Color(0.584314, 0.0352941, 0.141176, 1)
material = SubResource("StandardMaterial3D_phgri")
[sub_resource type="SphereShape3D" id="SphereShape3D_rokeu"]
radius = 0.8
radius = 0.2
[node name="TestBullet" type="Node3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.538645, 0)
@@ -22,9 +22,8 @@ _projectileSpeed = 15.0
collision_layer = 34
collision_mask = 32
gravity_scale = 0.0
custom_integrator = true
continuous_cd = true
max_contacts_reported = 10
max_contacts_reported = 1000
contact_monitor = true
can_sleep = false
@@ -34,12 +33,17 @@ mesh = SubResource("SphereMesh_wuk0e")
skeleton = NodePath("../..")
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0905764, 0, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0054872, -0.00215495, 0.0167444)
shape = SubResource("SphereShape3D_rokeu")
[node name="Sprite3D" type="Sprite3D" parent="RigidBody3D"]
pixel_size = 0.05
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00168204, -0.0587139, 0)
axis = 1
texture = ExtResource("2_n5c16")
[node name="TTL" type="Timer" parent="."]
process_callback = 0
autostart = true
[connection signal="body_entered" from="RigidBody3D" to="." method="OnBulletHitObject"]
[connection signal="timeout" from="TTL" to="." method="OnTimeToLiveTimeout"]

View File

@@ -1,7 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://brbshysbgd47q"]
[gd_scene load_steps=3 format=3 uid="uid://brbshysbgd47q"]
[ext_resource type="Script" path="res://Scripts/GodCircuit.cs" id="1_gyfww"]
[ext_resource type="PackedScene" uid="uid://cigdj84f0m3jd" path="res://Levels/Models/god circuit stage 1.glb" id="1_w12q0"]
[node name="God Circuit" type="Node3D"]
script = ExtResource("1_gyfww")
[node name="god circuit stage 1" parent="." instance=ExtResource("1_w12q0")]

12
Scripts/GodCircuit.cs Normal file
View File

@@ -0,0 +1,12 @@
using Godot;
public partial class GodCircuit : Node3D
{
private void OnHit(Node3D node)
{
GD.Print("Hit");
var hpComponent = GetNode<HealthPoints>("HP Component");
hpComponent.TakeDamage(800000);
hpComponent.UpdateHealthbar();
}
}

28
Scripts/HealthPoints.cs Normal file
View File

@@ -0,0 +1,28 @@
using Godot;
public partial class HealthPoints : Node
{
[Export]
public long MaximumHP { get; protected set; }
public long CurrentHP { get; protected set; }
[Export]
private TextureProgressBar _healthBar;
public override void _Ready()
{
CurrentHP = MaximumHP;
}
public void TakeDamage(long damage)
{
CurrentHP -= damage;
GD.Print(CurrentHP);
}
public void UpdateHealthbar()
{
_healthBar.Value = CurrentHP;
}
}

View File

@@ -0,0 +1,9 @@
using Godot;
public partial class HealthbarProgress : TextureProgressBar
{
public void UpdateBar(long amount, long full)
{
Value = amount;
}
}

View File

@@ -1,5 +0,0 @@
using Godot;
public partial class Level2 : Node3D
{
}

View File

@@ -16,6 +16,8 @@ public partial class MainMenu : Node2D
var bgmPlayer = GetTree().Root.GetNode<BGMPlayer>("BgmPlayer");
bgmPlayer.SetBGMFromFilepath("Audio/BGM/02 MovinOn.mp3");
bgmPlayer.PlayBGM();
var main = GetTree().Root.GetNode<Main>("/root/Main");
main.LoadLevel(0);
}
private void OnStartButtonPressed()

View File

@@ -56,7 +56,7 @@ public partial class TestCharacter : CharacterBody3D
private async void Fire()
{
var projectile = _fireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, -3f);
projectile.Position = Position + new Vector3(0f, 1f, -1f);
GetParent().AddChild(projectile);
CanShoot = false;
await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout");
@@ -66,7 +66,7 @@ public partial class TestCharacter : CharacterBody3D
private async void AltFire()
{
var projectile = _altFireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, -3f);
projectile.Position = Position + new Vector3(0f, 1f, -1f);
GetParent().AddChild(projectile);
CanShoot = false;
await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout");

View File

@@ -14,7 +14,7 @@ public partial class TestEnemy : RigidBody3D
LookAt(player.Position);
}
public override async void _PhysicsProcess(double delta)
public override void _PhysicsProcess(double delta)
{
_pathFollow.Progress += _speed * (float)delta;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dieoh0r7a5try"
path="res://.godot/imported/Pisces.jpg-c351c8459f4e19b9a85580584007606d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Textures/Portraits/Pisces.jpg"
dest_files=["res://.godot/imported/Pisces.jpg-c351c8459f4e19b9a85580584007606d.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
Textures/Style_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ccnmmyvs53gni"
path="res://.godot/imported/Style_1.png-17c1593f269805b264cd152373e129bb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Textures/Style_1.png"
dest_files=["res://.godot/imported/Style_1.png-17c1593f269805b264cd152373e129bb.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1