Refactor Player and Character

This commit is contained in:
2023-09-04 06:42:02 -07:00
parent a8ea40dee8
commit c32bbfe45a
16 changed files with 132 additions and 206 deletions

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=27 format=3 uid="uid://bgkqfamdiwrrw"]
[ext_resource type="Script" path="res://Scripts/Player1.cs" id="1_onedk"]
[ext_resource type="Script" path="res://Scripts/Character.cs" id="1_yxmbs"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_4qqwi"]
resource_name = "Material.006"
@@ -603,7 +603,7 @@ size = Vector3(0.822782, 0.527059, 0.80108)
size = Vector3(1.19222, 2.13872, 1.37879)
[node name="Megami" type="CharacterBody3D"]
script = ExtResource("1_onedk")
script = ExtResource("1_yxmbs")
[node name="Pivot" type="Node3D" parent="."]

View File

@@ -1,8 +1,8 @@
[gd_scene load_steps=7 format=3 uid="uid://b38hcomu4tpm5"]
[ext_resource type="Script" path="res://Scripts/Player1.cs" id="1_6cdju"]
[ext_resource type="PackedScene" uid="uid://cyn2wn6ffsnu7" path="res://Scenes/Weapons/Single.tscn" id="2_1c3c8"]
[ext_resource type="PackedScene" uid="uid://bq40xbqibrk1y" path="res://Scenes/Weapons/ShotgunBullet.tscn" id="3_4eh4a"]
[ext_resource type="Script" path="res://Scripts/Character.cs" id="1_gro0b"]
[ext_resource type="PackedScene" uid="uid://cyn2wn6ffsnu7" path="res://Scenes/Weapons/Single.tscn" id="2_y0wmm"]
[ext_resource type="PackedScene" uid="uid://bq40xbqibrk1y" path="res://Scenes/Weapons/ShotgunBullet.tscn" id="3_p4fqi"]
[ext_resource type="PackedScene" uid="uid://yosw0j58nvrf" path="res://Models/Characters/fwitch.gltf" id="4_mtwuo"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ayco3"]
@@ -15,10 +15,9 @@ height = 1.67894
[node name="Pisces" type="CharacterBody3D" groups=["Player"]]
transform = Transform3D(0.33, 0, 0, 0, 0.33, 0, 0, 0, 0.33, 0, 0, 0)
script = ExtResource("1_6cdju")
_speed = 2.0
_fireProjectile = ExtResource("2_1c3c8")
_altFireProjectile = ExtResource("3_4eh4a")
script = ExtResource("1_gro0b")
_fireProjectile = ExtResource("2_y0wmm")
_altFireProjectile = ExtResource("3_p4fqi")
[node name="Pivot" type="Node3D" parent="."]

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=7 format=3 uid="uid://iempdafdn6ct"]
[ext_resource type="Script" path="res://Scripts/Player1.cs" id="1_mn5ui"]
[ext_resource type="Script" path="res://Scripts/Character.cs" id="1_mn5ui"]
[ext_resource type="PackedScene" uid="uid://dyhimd6qec8fu" path="res://Scenes/Characters/ScorpioAnimated.tscn" id="2_pahgr"]
[ext_resource type="PackedScene" uid="uid://cxnek5wgpxbft" path="res://Scenes/Weapons/CutterShot.tscn" id="2_uayjr"]
[ext_resource type="PackedScene" uid="uid://cwt4rum7tvyvb" path="res://Scenes/Weapons/CutterShotAltFire.tscn" id="3_tw078"]
@@ -15,7 +15,6 @@ size = Vector3(0.822782, 0.527059, 0.80108)
collision_layer = 0
collision_mask = 4097
script = ExtResource("1_mn5ui")
_speed = 3.0
_fireProjectile = ExtResource("2_uayjr")
_altFireProjectile = ExtResource("3_tw078")

View File

@@ -1,16 +1,14 @@
[gd_scene load_steps=7 format=3 uid="uid://cxj6yeddshy16"]
[gd_scene load_steps=6 format=3 uid="uid://cxj6yeddshy16"]
[ext_resource type="Script" path="res://Scripts/GameManager.cs" id="1_ya2kt"]
[ext_resource type="PackedScene" uid="uid://b38hcomu4tpm5" path="res://Scenes/Characters/PiscesWitch.tscn" id="2_am26u"]
[ext_resource type="PackedScene" uid="uid://iempdafdn6ct" path="res://Scenes/Characters/PlayerScorpio.tscn" id="3_e5mhu"]
[ext_resource type="PackedScene" uid="uid://bgkqfamdiwrrw" path="res://Scenes/Characters/Megami.tscn" id="4_1hwqs"]
[ext_resource type="PackedScene" uid="uid://xcmspevaqcrc" path="res://Scenes/Player1.tscn" id="4_3fl70"]
[ext_resource type="PackedScene" uid="uid://dq1gtd55p04do" path="res://Scenes/StageGUI.tscn" id="5_gsh7q"]
[ext_resource type="Script" path="res://Scripts/SpawnPoint.cs" id="7_4n1rc"]
[ext_resource type="PackedScene" uid="uid://jircpua5fl80" path="res://Scenes/Player2.tscn" id="8_sixv3"]
[node name="GameManager" type="Node3D"]
script = ExtResource("1_ya2kt")
_p1Characters = [ExtResource("2_am26u"), ExtResource("3_e5mhu"), ExtResource("4_1hwqs")]
_p2Characters = [ExtResource("2_am26u"), ExtResource("3_e5mhu"), ExtResource("4_1hwqs")]
PlayerScenes = Array[PackedScene]([ExtResource("4_3fl70"), ExtResource("8_sixv3")])
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, -0.527878, 10.966, 6.61121)
@@ -37,4 +35,10 @@ script = ExtResource("7_4n1rc")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -0.504317, 0.863519, 0, -0.863519, -0.504317, 0, 19.9508, 0)
[connection signal="OnCharacterSelectionMade" from="StageGUI" to="." method="OnP1CharacterSelected"]
[node name="Player1" parent="." node_paths=PackedStringArray("SpawnPoint") instance=ExtResource("4_3fl70")]
SpawnPoint = NodePath("../P1SpawnPoint")
[node name="Player2" parent="." node_paths=PackedStringArray("SpawnPoint") instance=ExtResource("8_sixv3")]
SpawnPoint = NodePath("../P2SpawnPoint")
[connection signal="OnCharacterSelectionMade" from="StageGUI" to="." method="OnCharacterSelected"]

15
Scenes/Player1.tscn Normal file
View File

@@ -0,0 +1,15 @@
[gd_scene load_steps=6 format=3 uid="uid://xcmspevaqcrc"]
[ext_resource type="Script" path="res://Scripts/Player.cs" id="1_ctl2x"]
[ext_resource type="PackedScene" uid="uid://b38hcomu4tpm5" path="res://Scenes/Characters/PiscesWitch.tscn" id="2_7c6mk"]
[ext_resource type="Script" path="res://Scripts/SpawnPoint.cs" id="2_mkhuu"]
[ext_resource type="PackedScene" uid="uid://iempdafdn6ct" path="res://Scenes/Characters/PlayerScorpio.tscn" id="3_mtqa2"]
[ext_resource type="PackedScene" uid="uid://bgkqfamdiwrrw" path="res://Scenes/Characters/Megami.tscn" id="4_1xs5f"]
[node name="Player1" type="Node3D" node_paths=PackedStringArray("SpawnPoint")]
script = ExtResource("1_ctl2x")
SpawnPoint = NodePath("Marker3D")
PlayableCharacters = Array[PackedScene]([ExtResource("2_7c6mk"), ExtResource("3_mtqa2"), ExtResource("4_1xs5f")])
[node name="Marker3D" type="Marker3D" parent="."]
script = ExtResource("2_mkhuu")

15
Scenes/Player2.tscn Normal file
View File

@@ -0,0 +1,15 @@
[gd_scene load_steps=6 format=3 uid="uid://jircpua5fl80"]
[ext_resource type="Script" path="res://Scripts/Player.cs" id="1_k788q"]
[ext_resource type="Script" path="res://Scripts/SpawnPoint.cs" id="1_xs6nn"]
[ext_resource type="PackedScene" uid="uid://b38hcomu4tpm5" path="res://Scenes/Characters/PiscesWitch.tscn" id="2_ehwtn"]
[ext_resource type="PackedScene" uid="uid://iempdafdn6ct" path="res://Scenes/Characters/PlayerScorpio.tscn" id="3_eamga"]
[ext_resource type="PackedScene" uid="uid://bgkqfamdiwrrw" path="res://Scenes/Characters/Megami.tscn" id="4_uj8bq"]
[node name="Player2" type="Node3D" node_paths=PackedStringArray("SpawnPoint")]
script = ExtResource("1_k788q")
SpawnPoint = NodePath("Marker3D")
PlayableCharacters = Array[PackedScene]([ExtResource("2_ehwtn"), ExtResource("3_eamga"), ExtResource("4_uj8bq")])
[node name="Marker3D" type="Marker3D" parent="."]
script = ExtResource("1_xs6nn")

View File

@@ -15,6 +15,10 @@ _projectileSpeed = 10.0
collision_layer = 2
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1000
contact_monitor = true
can_sleep = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.644825, 0)