This commit is contained in:
2023-09-06 14:43:12 -07:00
parent f8cca640a6
commit d536aa2014
41 changed files with 2747 additions and 1011 deletions

View File

@@ -1,25 +1,32 @@
using Godot;
using Godot;
public partial class P1Controls : Controls
public partial class Character : CharacterBody3D
{
[Export]
private PackedScene _fireProjectile;
protected PackedScene _fireProjectile;
[Export]
private PackedScene _altFireProjectile;
protected PackedScene _altFireProjectile;
protected Player _ownerPlayer;
[Export]
private float _speed = 3.0f;
protected float _speed = 3.0f;
public bool CanShoot { get; protected set; }
private GameManager _gameManager;
protected GameManager _gameManager;
public override void _Ready()
public override void _EnterTree()
{
CanShoot = true;
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
}
public void Initialize(Player ownerPlayer)
{
_ownerPlayer = ownerPlayer;
}
public override void _PhysicsProcess(double delta)
{
Velocity = CalculateCharacterMovement(delta);
@@ -31,9 +38,9 @@ public partial class P1Controls : Controls
if (Input.IsActionJustPressed("exit"))
GetTree().Quit();
if (Input.IsActionJustPressed($"p1_fire") && CanShoot)
if (Input.IsActionJustPressed(_ownerPlayer.PlayerInput.Fire()) && CanShoot)
Fire();
if (Input.IsActionJustPressed($"p1_altfire") && CanShoot)
if (Input.IsActionJustPressed(_ownerPlayer.PlayerInput.AltFire()) && CanShoot)
AltFire();
}
@@ -41,7 +48,7 @@ public partial class P1Controls : Controls
{
var velocity = Velocity;
var inputDir = Input.GetVector($"p1_left", $"p1_right", $"p1_up", $"p1_down");
var inputDir = Input.GetVector(_ownerPlayer.PlayerInput.Left(), _ownerPlayer.PlayerInput.Right(), _ownerPlayer.PlayerInput.Up(), _ownerPlayer.PlayerInput.Down());
var direction = (Transform.Basis * new Vector3(inputDir.X, 0, inputDir.Y)).Normalized();
if (direction != Vector3.Zero)
{
@@ -82,6 +89,6 @@ public partial class P1Controls : Controls
public void OnHit(Node3D node)
{
if (this != null)
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, this);
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, _ownerPlayer);
}
}

View File

@@ -1,11 +0,0 @@
using Godot;
public partial class Controls : CharacterBody3D
{
private GameManager _gameManager;
public override void _Ready()
{
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
}
}

View File

@@ -1,85 +0,0 @@
using Godot;
public partial class P2Controls : Controls
{
[Export]
private PackedScene _fireProjectile;
[Export]
private PackedScene _altFireProjectile;
[Export]
private float _speed = 3.0f;
public bool CanShoot { get; protected set; }
private GameManager _gameManager;
public override void _Ready()
{
CanShoot = true;
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
}
public override void _PhysicsProcess(double delta)
{
Velocity = CalculateCharacterMovement(delta);
MoveAndSlide();
}
public override void _UnhandledInput(InputEvent @event)
{
if (Input.IsActionJustPressed("exit"))
GetTree().Quit();
if (Input.IsActionJustPressed($"p2_fire") && CanShoot)
Fire();
if (Input.IsActionJustPressed($"p2_altfire") && CanShoot)
AltFire();
}
private Vector3 CalculateCharacterMovement(double delta)
{
var velocity = Velocity;
var inputDir = Input.GetVector($"p2_left", $"p2_right", $"p2_up", $"p2_down");
var direction = (Transform.Basis * new Vector3(inputDir.X, 0, inputDir.Y)).Normalized();
if (direction != Vector3.Zero)
{
velocity.X = direction.X * _speed;
velocity.Z = direction.Z * _speed;
GetNode<Node3D>("Pivot").LookAt(Position + direction, Vector3.Up);
GetNode<Node3D>("CollisionShape3D").LookAt(Position + direction, Vector3.Up);
}
else
{
velocity.X = Mathf.MoveToward(Velocity.X, 0, _speed);
velocity.Z = Mathf.MoveToward(Velocity.Z, 0, _speed);
}
return velocity;
}
private async void Fire()
{
var projectile = _fireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, 0f);
GetParent().AddChild(projectile);
CanShoot = false;
await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout");
CanShoot = true;
}
private async void AltFire()
{
var projectile = _altFireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, 0f);
GetParent().AddChild(projectile);
CanShoot = false;
await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout");
CanShoot = true;
}
public void OnHit(Node3D node)
{
_gameManager.RemoveCharacter(this);
}
}

38
Player/Base/Player.cs Normal file
View File

@@ -0,0 +1,38 @@
using Godot;
using Godot.Collections;
public partial class Player : Node3D
{
[Export]
public SpawnPoint SpawnPoint;
[Export]
public Array<PackedScene> PlayableCharacterScenes;
[Export]
public PlayerInput PlayerInput;
[Export]
public int PlayerNumber;
public Array<Character> CharactersLeftOnStage = new Array<Character>();
public Array<Character> CharactersExited = new Array<Character>();
public Character SelectedCharacter;
public bool IsSelectingCharacter = false;
public int CharacterIndex = 0;
public bool GameOver = false;
public override void _Ready()
{
foreach (var character in PlayableCharacterScenes)
{
var instance = (Character)character.Instantiate();
instance.Initialize(this);
CharactersLeftOnStage.Add(instance);
}
}
}

View File

@@ -1,18 +1,23 @@
[gd_scene load_steps=7 format=3 uid="uid://xcmspevaqcrc"]
[gd_scene load_steps=8 format=3 uid="uid://xcmspevaqcrc"]
[ext_resource type="Script" path="res://Player/Base/PlayerManager.cs" id="1_mmi2c"]
[ext_resource type="PackedScene" uid="uid://b38hcomu4tpm5" path="res://Player/Pisces/P1PiscesWitch.tscn" id="2_g10gf"]
[ext_resource type="PackedScene" uid="uid://iempdafdn6ct" path="res://Player/Scorpio/P1PlayerScorpio.tscn" id="3_nsh6r"]
[ext_resource type="PackedScene" uid="uid://bgkqfamdiwrrw" path="res://Player/Sagittarius/P1Megami.tscn" id="4_vnhuv"]
[ext_resource type="PackedScene" uid="uid://crkon4c8ah1a2" path="res://Player/Capricorn/CapricornP1.tscn" id="5_ccoeb"]
[ext_resource type="Script" path="res://Player/Base/Player.cs" id="1_otv3t"]
[ext_resource type="PackedScene" uid="uid://b38hcomu4tpm5" path="res://Player/Pisces/Pisces.tscn" id="2_g10gf"]
[ext_resource type="PackedScene" uid="uid://iempdafdn6ct" path="res://Player/Scorpio/Scorpio.tscn" id="3_nsh6r"]
[ext_resource type="PackedScene" uid="uid://bgkqfamdiwrrw" path="res://Player/Sagittarius/Sagittarius.tscn" id="4_vnhuv"]
[ext_resource type="PackedScene" uid="uid://crkon4c8ah1a2" path="res://Player/Capricorn/Capricorn.tscn" id="5_ccoeb"]
[ext_resource type="Script" path="res://Player/Base/SpawnPoint.cs" id="6_lida8"]
[ext_resource type="PackedScene" uid="uid://dklmu3wwoukmw" path="res://Player/Base/Player1Input.tscn" id="7_nyh7j"]
[node name="Player1" type="Node3D" node_paths=PackedStringArray("SpawnPoint")]
script = ExtResource("1_mmi2c")
[node name="Player1" type="Node3D" node_paths=PackedStringArray("SpawnPoint", "PlayerInput")]
script = ExtResource("1_otv3t")
SpawnPoint = NodePath("Marker3D")
PlayableCharacterScenes = Array[PackedScene]([ExtResource("2_g10gf"), ExtResource("3_nsh6r"), ExtResource("4_vnhuv"), ExtResource("5_ccoeb")])
PlayerInput = NodePath("Player1Input")
PlayerNumber = 1
[node name="Marker3D" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 0, 5.513)
gizmo_extents = 1.0
script = ExtResource("6_lida8")
[node name="Player1Input" parent="." instance=ExtResource("7_nyh7j")]

View File

@@ -0,0 +1,14 @@
public partial class Player1Input : PlayerInput
{
public override string Up() => "p1_up";
public override string Down() => "p1_down";
public override string Left() => "p1_left";
public override string Right() => "p1_right";
public override string Fire() => "p1_fire";
public override string AltFire() => "p1_altfire";
}

View File

@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://dklmu3wwoukmw"]
[ext_resource type="Script" path="res://Player/Base/Player1Input.cs" id="1_te7aw"]
[node name="Player1Input" type="Node"]
script = ExtResource("1_te7aw")

View File

@@ -1,15 +1,23 @@
[gd_scene load_steps=5 format=3 uid="uid://b57xus5rqasy8"]
[gd_scene load_steps=8 format=3 uid="uid://b57xus5rqasy8"]
[ext_resource type="Script" path="res://Player/Base/PlayerManager.cs" id="1_gttsr"]
[ext_resource type="Script" path="res://Player/Base/Player.cs" id="1_wlxdt"]
[ext_resource type="Script" path="res://Player/Base/SpawnPoint.cs" id="1_xs6nn"]
[ext_resource type="PackedScene" uid="uid://dfanwejjy3iue" path="res://Player/Pisces/P2PiscesWitch.tscn" id="2_78cal"]
[ext_resource type="PackedScene" uid="uid://cg6hdoeq70ke8" path="res://Player/Scorpio/P2PlayerScorpio.tscn" id="3_04rrx"]
[ext_resource type="PackedScene" uid="uid://b38hcomu4tpm5" path="res://Player/Pisces/Pisces.tscn" id="2_gtqii"]
[ext_resource type="PackedScene" uid="uid://iempdafdn6ct" path="res://Player/Scorpio/Scorpio.tscn" id="3_0k4g2"]
[ext_resource type="PackedScene" uid="uid://bgkqfamdiwrrw" path="res://Player/Sagittarius/Sagittarius.tscn" id="4_0vqor"]
[ext_resource type="PackedScene" uid="uid://crkon4c8ah1a2" path="res://Player/Capricorn/Capricorn.tscn" id="5_ke8lm"]
[ext_resource type="PackedScene" uid="uid://bsvjdu8ao1wva" path="res://Player/Base/Player2Input.tscn" id="5_u4w27"]
[node name="Player2" type="Node3D" groups=["Player"]]
script = ExtResource("1_gttsr")
PlayableCharacterScenes = Array[PackedScene]([ExtResource("2_78cal"), ExtResource("3_04rrx")])
[node name="Player2" type="Node3D" node_paths=PackedStringArray("SpawnPoint", "PlayerInput") groups=["Player"]]
script = ExtResource("1_wlxdt")
SpawnPoint = NodePath("Marker3D")
PlayableCharacterScenes = Array[PackedScene]([ExtResource("2_gtqii"), ExtResource("3_0k4g2"), ExtResource("4_0vqor"), ExtResource("5_ke8lm")])
PlayerInput = NodePath("Player2Input")
PlayerNumber = 2
[node name="Marker3D" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.5, 0, 5.513)
gizmo_extents = 1.0
script = ExtResource("1_xs6nn")
[node name="Player2Input" parent="." instance=ExtResource("5_u4w27")]

View File

@@ -0,0 +1,14 @@
public partial class Player2Input : PlayerInput
{
public override string Up() => "p2_up";
public override string Down() => "p2_down";
public override string Left() => "p2_left";
public override string Right() => "p2_right";
public override string Fire() => "p2_fire";
public override string AltFire() => "p2_altfire";
}

View File

@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://bsvjdu8ao1wva"]
[ext_resource type="Script" path="res://Player/Base/Player2Input.cs" id="1_j3rvl"]
[node name="Player2Input" type="Node"]
script = ExtResource("1_j3rvl")

View File

@@ -0,0 +1,35 @@
using Godot;
public partial class PlayerInput : Node
{
public virtual string Up()
{
GD.PrintErr("Using base type");
return string.Empty;
}
public virtual string Down()
{
GD.PrintErr("Using base type");
return string.Empty;
}
public virtual string Left()
{
GD.PrintErr("Using base type");
return string.Empty;
}
public virtual string Right()
{
GD.PrintErr("Using base type");
return string.Empty;
}
public virtual string Fire()
{
GD.PrintErr("Using base type");
return string.Empty;
}
public virtual string AltFire()
{
GD.PrintErr("Using base type");
return string.Empty;
}
}

View File

@@ -1,30 +0,0 @@
using Godot;
using Godot.Collections;
public partial class PlayerManager : Node3D
{
[Export]
public SpawnPoint SpawnPoint;
[Export]
public Array<PackedScene> PlayableCharacterScenes;
public Array<Controls> CharactersLeftOnStage = new Array<Controls>();
public Controls SelectedCharacter;
public bool IsSelectingCharacter = false;
public int _characterIndex = 0;
public bool GameOver = false;
public override void _Ready()
{
foreach (var character in PlayableCharacterScenes)
{
var instance = character.Instantiate();
CharactersLeftOnStage.Add((Controls)instance);
}
}
}

View File

@@ -7,10 +7,10 @@ public partial class Projectile : Node3D
[Export]
public AudioStream _soundEffect;
public Controls ParentCharacter;
public Character ParentCharacter;
[Export]
private float _projectileSpeed = 1f;
protected float _projectileSpeed = 1f;
public override void _Ready()
{

View File

@@ -1,20 +1,37 @@
[gd_scene load_steps=5 format=3 uid="uid://5ce7ky4o0q2e"]
[gd_scene load_steps=6 format=3 uid="uid://5ce7ky4o0q2e"]
[ext_resource type="Texture2D" uid="uid://dha44dnvwhajo" path="res://Textures/Projectiles/Projectile_Capricorn.png" id="1_bvyt4"]
[ext_resource type="Script" path="res://Player/Capricorn/Attacks/CapricornLaserShot.cs" id="1_nkyy8"]
[ext_resource type="AudioStream" uid="uid://bykwwct1not4e" path="res://Audio/SFX/capricorn laeser.wav" id="2_lofnw"]
[sub_resource type="Curve3D" id="Curve3D_bnc6v"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0.008, 1, -5),
"tilts": PackedFloat32Array(0, 0)
}
point_count = 2
[sub_resource type="CylinderShape3D" id="CylinderShape3D_bnunv"]
height = 7.40727
radius = 0.419241
[node name="CapricornLaser" type="Node3D"]
script = ExtResource("1_nkyy8")
Cooldown = 1.0
_soundEffect = ExtResource("2_lofnw")
_projectileSpeed = 3.0
[node name="Forward Shot" type="RigidBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.5)
[node name="Forward Shot" type="Path3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.25)
top_level = true
curve = SubResource("Curve3D_bnc6v")
[node name="PathFollow3D" type="PathFollow3D" parent="Forward Shot"]
transform = Transform3D(-0.999998, 0, 0.00159994, 0, 1, 0, -0.00159994, 0, -0.999998, 0, 1, 0)
loop = false
tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Forward Shot/PathFollow3D"]
transform = Transform3D(-1, 0, -0.000800046, 0, 1, 0, 0.000800046, 0, -1, 0.000400023, -1, 0.5)
collision_layer = 0
collision_mask = 34
gravity_scale = 0.0
@@ -23,18 +40,28 @@ max_contacts_reported = 1
contact_monitor = true
can_sleep = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="Forward Shot"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Forward Shot/PathFollow3D/Hitbox"]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
shape = SubResource("CylinderShape3D_bnunv")
[node name="Sprite3D2" type="Sprite3D" parent="Forward Shot"]
[node name="Sprite3D2" type="Sprite3D" parent="Forward Shot/PathFollow3D/Hitbox"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.33, 0, 0.5)
centered = false
axis = 1
texture = ExtResource("1_bvyt4")
[node name="BackwardShot" type="RigidBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0.5)
[node name="Backward Shot" type="Path3D" parent="."]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0.25)
top_level = true
curve = SubResource("Curve3D_bnc6v")
[node name="PathFollow3D" type="PathFollow3D" parent="Backward Shot"]
transform = Transform3D(-0.999998, 0, 0.00159994, 0, 1, 0, -0.00159994, 0, -0.999998, 0, 1, 0)
loop = false
tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Backward Shot/PathFollow3D"]
transform = Transform3D(-1, 0, -0.000800046, 0, 1, 0, 0.000800046, 0, -1, 0.000400023, -1, 0.5)
collision_layer = 0
collision_mask = 34
gravity_scale = 0.0
@@ -43,12 +70,12 @@ max_contacts_reported = 1
contact_monitor = true
can_sleep = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="BackwardShot"]
transform = Transform3D(-0.5, 0, -4.37114e-08, 0, 0.5, 0, 4.37114e-08, 0, -0.5, 0, -0.5, 0.5)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Backward Shot/PathFollow3D/Hitbox"]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
shape = SubResource("CylinderShape3D_bnunv")
[node name="Sprite3D2" type="Sprite3D" parent="BackwardShot/CollisionShape3D"]
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, -0.66, 0, 0.965768)
[node name="Sprite3D2" type="Sprite3D" parent="Backward Shot/PathFollow3D/Hitbox"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.33, 0, 0.5)
centered = false
axis = 1
texture = ExtResource("1_bvyt4")

View File

@@ -1,21 +1,39 @@
[gd_scene load_steps=5 format=3 uid="uid://cdsc35cj566q1"]
[gd_scene load_steps=6 format=3 uid="uid://cdsc35cj566q1"]
[ext_resource type="Script" path="res://Player/Capricorn/Attacks/CapricornLaserShot.cs" id="1_8lywi"]
[ext_resource type="Texture2D" uid="uid://dha44dnvwhajo" path="res://Textures/Projectiles/Projectile_Capricorn.png" id="2_8osg4"]
[ext_resource type="AudioStream" uid="uid://bykwwct1not4e" path="res://Audio/SFX/capricorn laeser.wav" id="2_jeoco"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_bnunv"]
height = 8.32444
[sub_resource type="Curve3D" id="Curve3D_goxuk"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0.008, 1, -5),
"tilts": PackedFloat32Array(0, 0)
}
point_count = 2
[sub_resource type="CylinderShape3D" id="CylinderShape3D_hebl4"]
height = 7.40727
radius = 0.419241
[node name="CapricornLaser" type="Node3D"]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -0.242816, 0, 0)
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0)
script = ExtResource("1_8lywi")
Cooldown = 1.0
_soundEffect = ExtResource("2_jeoco")
_projectileSpeed = 3.0
[node name="Forward Shot" type="RigidBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.5)
[node name="Forward Shot" type="Path3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.25)
top_level = true
curve = SubResource("Curve3D_goxuk")
[node name="PathFollow3D" type="PathFollow3D" parent="Forward Shot"]
transform = Transform3D(-0.999998, 0, 0.00159994, 0, 1, 0, -0.00159994, 0, -0.999998, 0, 1, 0)
loop = false
tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Forward Shot/PathFollow3D"]
transform = Transform3D(-1, 0, -0.000800046, 0, 1, 0, 0.000800046, 0, -1, 0.000400023, -1, 0.5)
collision_layer = 34
collision_mask = 34
gravity_scale = 0.0
@@ -24,18 +42,28 @@ max_contacts_reported = 1
contact_monitor = true
can_sleep = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="Forward Shot"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Forward Shot/PathFollow3D/Hitbox"]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
shape = SubResource("CylinderShape3D_bnunv")
shape = SubResource("CylinderShape3D_hebl4")
[node name="Sprite3D2" type="Sprite3D" parent="Forward Shot"]
[node name="Sprite3D2" type="Sprite3D" parent="Forward Shot/PathFollow3D/Hitbox"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.33, 0, 0.5)
centered = false
axis = 1
texture = ExtResource("2_8osg4")
[node name="BackwardShot" type="RigidBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0.5)
[node name="Backward Shot" type="Path3D" parent="."]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0.25)
top_level = true
curve = SubResource("Curve3D_goxuk")
[node name="PathFollow3D" type="PathFollow3D" parent="Backward Shot"]
transform = Transform3D(-0.999998, 0, 0.00159994, 0, 1, 0, -0.00159994, 0, -0.999998, 0, 1, 0)
loop = false
tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Backward Shot/PathFollow3D"]
transform = Transform3D(-1, 0, -0.000800046, 0, 1, 0, 0.000800046, 0, -1, 0.000400023, -1, 0.5)
collision_layer = 34
collision_mask = 34
gravity_scale = 0.0
@@ -44,12 +72,12 @@ max_contacts_reported = 1
contact_monitor = true
can_sleep = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="BackwardShot"]
transform = Transform3D(-0.5, 0, -4.37114e-08, 0, 0.5, 0, 4.37114e-08, 0, -0.5, 0, -0.5, 0.5)
shape = SubResource("CylinderShape3D_bnunv")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Backward Shot/PathFollow3D/Hitbox"]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
shape = SubResource("CylinderShape3D_hebl4")
[node name="Sprite3D2" type="Sprite3D" parent="BackwardShot/CollisionShape3D"]
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, -0.66, 0, 0.965768)
[node name="Sprite3D2" type="Sprite3D" parent="Backward Shot/PathFollow3D/Hitbox"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.33, 0, 0.5)
centered = false
axis = 1
texture = ExtResource("2_8osg4")

View File

@@ -1,12 +1,35 @@
using Godot;
using Godot.Collections;
using System.Linq;
public partial class CapricornLaserShot : Projectile
{
private Array<Path3D> _paths;
public new float Speed { get; private set; }
public override void _Ready()
{
Speed = _projectileSpeed;
var sfxPlayer = GetTree().Root.GetNode<AudioStreamPlayer>("Main/SFXPlayer");
sfxPlayer.Stream = _soundEffect;
sfxPlayer.Play();
_paths = new Array<Path3D>(GetChildren().OfType<Path3D>());
}
public override void _PhysicsProcess(double delta)
{
var shots = GetChildren().OfType<RigidBody3D>();
shots.ElementAt(0).Translate(new Vector3(0, 0, Speed * -(float)delta));
shots.ElementAt(1).Translate(new Vector3(0, 0, Speed * (float)delta));
foreach (var paths in _paths)
{
var pathFollow = paths.GetChildren().OfType<PathFollow3D>().Single();
pathFollow.Progress += Speed * (float)delta;
if (Mathf.IsEqualApprox(pathFollow.ProgressRatio, 1.0f))
QueueFree();
}
}
private void OnBulletHitObject(Node node)
{
QueueFree();
}
}

View File

@@ -1,109 +1,109 @@
[gd_scene load_steps=36 format=3 uid="uid://crkon4c8ah1a2"]
[ext_resource type="Script" path="res://Player/Capricorn/CapricornP1Controls.cs" id="1_02lam"]
[ext_resource type="PackedScene" uid="uid://5ce7ky4o0q2e" path="res://Player/Capricorn/Attacks/CapricornLaser.tscn" id="2_5fur4"]
[ext_resource type="Texture2D" uid="uid://s0j0kj4ila8s" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_AttackForward.png" id="2_ebqay"]
[ext_resource type="PackedScene" uid="uid://cdsc35cj566q1" path="res://Player/Capricorn/Attacks/CapricornLaserAltFire.tscn" id="3_7c7sn"]
[ext_resource type="Texture2D" uid="uid://dchysrwcxhfvx" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_AttackBehind.png" id="3_c6jic"]
[ext_resource type="Texture2D" uid="uid://cju5ycxiuwy25" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_AttackSide.png" id="4_ivql6"]
[ext_resource type="Texture2D" uid="uid://utm2g5q7m2b3" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_WalkForward.png" id="5_7h4md"]
[ext_resource type="Texture2D" uid="uid://w444vcu8rvae" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_WalkBehind.png" id="6_go5g3"]
[ext_resource type="Texture2D" uid="uid://c5t256wcykb47" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_WalkSide.png" id="7_3c18n"]
[ext_resource type="Script" path="res://Player/Capricorn/CapricornControls.cs" id="1_aqn5t"]
[ext_resource type="PackedScene" uid="uid://5ce7ky4o0q2e" path="res://Player/Capricorn/Attacks/CapricornLaser.tscn" id="2_e6qos"]
[ext_resource type="Texture2D" uid="uid://s0j0kj4ila8s" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_AttackForward.png" id="2_ichjm"]
[ext_resource type="Texture2D" uid="uid://dchysrwcxhfvx" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_AttackBehind.png" id="3_qnhtc"]
[ext_resource type="PackedScene" uid="uid://cdsc35cj566q1" path="res://Player/Capricorn/Attacks/CapricornLaserAltFire.tscn" id="3_wbhxk"]
[ext_resource type="Texture2D" uid="uid://cju5ycxiuwy25" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_AttackSide.png" id="4_n8euj"]
[ext_resource type="Texture2D" uid="uid://utm2g5q7m2b3" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_WalkForward.png" id="5_coe3k"]
[ext_resource type="Texture2D" uid="uid://w444vcu8rvae" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_WalkBehind.png" id="6_2w4xq"]
[ext_resource type="Texture2D" uid="uid://c5t256wcykb47" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_WalkSide.png" id="7_uiqsg"]
[sub_resource type="AtlasTexture" id="AtlasTexture_njxhk"]
atlas = ExtResource("2_ebqay")
atlas = ExtResource("2_ichjm")
region = Rect2(0, 0, 120, 140)
[sub_resource type="AtlasTexture" id="AtlasTexture_bmuvx"]
atlas = ExtResource("2_ebqay")
atlas = ExtResource("2_ichjm")
region = Rect2(120, 0, 120, 140)
[sub_resource type="AtlasTexture" id="AtlasTexture_14ft5"]
atlas = ExtResource("2_ebqay")
atlas = ExtResource("2_ichjm")
region = Rect2(240, 0, 120, 140)
[sub_resource type="AtlasTexture" id="AtlasTexture_olmdj"]
atlas = ExtResource("2_ebqay")
atlas = ExtResource("2_ichjm")
region = Rect2(360, 0, 120, 140)
[sub_resource type="AtlasTexture" id="AtlasTexture_qaudm"]
atlas = ExtResource("3_c6jic")
atlas = ExtResource("3_qnhtc")
region = Rect2(0, 0, 120, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_a52sr"]
atlas = ExtResource("3_c6jic")
atlas = ExtResource("3_qnhtc")
region = Rect2(120, 0, 120, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_qkrgl"]
atlas = ExtResource("3_c6jic")
atlas = ExtResource("3_qnhtc")
region = Rect2(240, 0, 120, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_k5oj5"]
atlas = ExtResource("3_c6jic")
atlas = ExtResource("3_qnhtc")
region = Rect2(360, 0, 120, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_6iqcx"]
atlas = ExtResource("4_ivql6")
atlas = ExtResource("4_n8euj")
region = Rect2(0, 0, 113, 142)
[sub_resource type="AtlasTexture" id="AtlasTexture_kiiv3"]
atlas = ExtResource("4_ivql6")
atlas = ExtResource("4_n8euj")
region = Rect2(113, 0, 113, 142)
[sub_resource type="AtlasTexture" id="AtlasTexture_up4ur"]
atlas = ExtResource("4_ivql6")
atlas = ExtResource("4_n8euj")
region = Rect2(226, 0, 113, 142)
[sub_resource type="AtlasTexture" id="AtlasTexture_hvxie"]
atlas = ExtResource("4_ivql6")
atlas = ExtResource("4_n8euj")
region = Rect2(339, 0, 113, 142)
[sub_resource type="AtlasTexture" id="AtlasTexture_vc5hj"]
atlas = ExtResource("5_7h4md")
atlas = ExtResource("5_coe3k")
region = Rect2(0, 0, 120, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_672u0"]
atlas = ExtResource("5_7h4md")
atlas = ExtResource("5_coe3k")
region = Rect2(120, 0, 120, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_po3o8"]
atlas = ExtResource("5_7h4md")
atlas = ExtResource("5_coe3k")
region = Rect2(240, 0, 120, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_v0my0"]
atlas = ExtResource("5_7h4md")
atlas = ExtResource("5_coe3k")
region = Rect2(360, 0, 120, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_fge82"]
atlas = ExtResource("6_go5g3")
atlas = ExtResource("6_2w4xq")
region = Rect2(0, 0, 120, 132)
[sub_resource type="AtlasTexture" id="AtlasTexture_v2d05"]
atlas = ExtResource("6_go5g3")
atlas = ExtResource("6_2w4xq")
region = Rect2(120, 0, 120, 132)
[sub_resource type="AtlasTexture" id="AtlasTexture_mkdc6"]
atlas = ExtResource("6_go5g3")
atlas = ExtResource("6_2w4xq")
region = Rect2(240, 0, 120, 132)
[sub_resource type="AtlasTexture" id="AtlasTexture_0nnnw"]
atlas = ExtResource("6_go5g3")
atlas = ExtResource("6_2w4xq")
region = Rect2(360, 0, 120, 132)
[sub_resource type="AtlasTexture" id="AtlasTexture_sjqet"]
atlas = ExtResource("7_3c18n")
atlas = ExtResource("7_uiqsg")
region = Rect2(0, 0, 113, 130)
[sub_resource type="AtlasTexture" id="AtlasTexture_l8c3l"]
atlas = ExtResource("7_3c18n")
atlas = ExtResource("7_uiqsg")
region = Rect2(113, 0, 113, 130)
[sub_resource type="AtlasTexture" id="AtlasTexture_a72tn"]
atlas = ExtResource("7_3c18n")
atlas = ExtResource("7_uiqsg")
region = Rect2(226, 0, 113, 130)
[sub_resource type="AtlasTexture" id="AtlasTexture_s2v14"]
atlas = ExtResource("7_3c18n")
atlas = ExtResource("7_uiqsg")
region = Rect2(339, 0, 113, 130)
[sub_resource type="SpriteFrames" id="SpriteFrames_h2iud"]
@@ -214,14 +214,13 @@ animations = [{
[sub_resource type="BoxShape3D" id="BoxShape3D_r4spg"]
size = Vector3(0.856928, 1.65704, 0.82877)
[node name="CapricornP1" type="CharacterBody3D" groups=["Player"]]
[node name="Capricorn" type="CharacterBody3D" groups=["Player"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.408962, 0)
motion_mode = 1
script = ExtResource("1_02lam")
_fireProjectile = ExtResource("2_5fur4")
_altFireProjectile = ExtResource("3_7c7sn")
_fireProjectile = ExtResource("2_5fur4")
_altFireProjectile = ExtResource("3_7c7sn")
script = ExtResource("1_aqn5t")
_fireProjectile = ExtResource("2_e6qos")
_altFireProjectile = ExtResource("3_wbhxk")
_speed = 1.0
[node name="Pivot" type="Node3D" parent="."]

View File

@@ -1,28 +1,17 @@
using Godot;
public partial class CapricornP1Controls : P1Controls
public partial class CapricornControls : Character
{
private AnimatedSprite3D _sprite;
public override void _Ready()
{
base._Ready();
_sprite = GetNode<AnimatedSprite3D>("Pivot/Sprite");
CanShoot = true;
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
}
[Export]
private PackedScene _fireProjectile;
[Export]
private PackedScene _altFireProjectile;
[Export]
private float _speed = 3.0f;
public bool IsShooting = false;
private GameManager _gameManager;
public override void _PhysicsProcess(double delta)
{
Velocity = CalculateCharacterMovement(delta);
@@ -34,17 +23,17 @@ public partial class CapricornP1Controls : P1Controls
if (Input.IsActionJustPressed("exit"))
GetTree().Quit();
if (Input.IsActionJustPressed($"p1_fire") && CanShoot)
Fire();
if (Input.IsActionJustPressed($"p1_altfire") && CanShoot)
AltFire();
if (Input.IsActionJustPressed(_ownerPlayer.PlayerInput.Fire()) && CanShoot)
Fire(_fireProjectile);
if (Input.IsActionJustPressed(_ownerPlayer.PlayerInput.AltFire()) && CanShoot)
Fire(_altFireProjectile);
}
private Vector3 CalculateCharacterMovement(double delta)
{
var velocity = Velocity;
var inputDir = Input.GetVector($"p1_left", $"p1_right", $"p1_up", $"p1_down");
var inputDir = Input.GetVector(_ownerPlayer.PlayerInput.Left(), _ownerPlayer.PlayerInput.Right(), _ownerPlayer.PlayerInput.Up(), _ownerPlayer.PlayerInput.Down());
var direction = (Transform.Basis * new Vector3(inputDir.X, 0, inputDir.Y)).Normalized();
if (direction != Vector3.Zero)
{
@@ -91,25 +80,12 @@ public partial class CapricornP1Controls : P1Controls
_sprite.Play("WalkBack");
}
private async void Fire()
private async void Fire(PackedScene projectileScene)
{
IsShooting = true;
CanShoot = false;
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
var projectile = _fireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, 0f);
projectile.ParentCharacter = this;
GetParent().AddChild(projectile);
CanShoot = true;
IsShooting = false;
}
private async void AltFire()
{
IsShooting = true;
CanShoot = false;
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
var projectile = _altFireProjectile.Instantiate<Projectile>();
var projectile = projectileScene.Instantiate<Projectile>();
await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout");
projectile.Position = Position + new Vector3(0f, 1f, 0f);
projectile.ParentCharacter = this;
GetParent().AddChild(projectile);
@@ -143,6 +119,6 @@ public partial class CapricornP1Controls : P1Controls
public new void OnHit(Node3D node)
{
if (this != null)
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, this);
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, _ownerPlayer);
}
}

View File

@@ -1,248 +0,0 @@
[gd_scene load_steps=36 format=3 uid="uid://db6xew8wvbcl8"]
[ext_resource type="Script" path="res://Player/Capricorn/CapricornP2Controls.cs" id="1_5dwa3"]
[ext_resource type="Texture2D" uid="uid://s0j0kj4ila8s" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_AttackForward.png" id="2_8qhd4"]
[ext_resource type="PackedScene" uid="uid://5ce7ky4o0q2e" path="res://Player/Capricorn/Attacks/CapricornLaser.tscn" id="2_241c5"]
[ext_resource type="PackedScene" uid="uid://cdsc35cj566q1" path="res://Player/Capricorn/Attacks/CapricornLaserAltFire.tscn" id="3_4gj1h"]
[ext_resource type="Texture2D" uid="uid://dchysrwcxhfvx" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_AttackBehind.png" id="3_qftyj"]
[ext_resource type="Texture2D" uid="uid://cju5ycxiuwy25" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_AttackSide.png" id="4_pwka2"]
[ext_resource type="Texture2D" uid="uid://utm2g5q7m2b3" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_WalkForward.png" id="5_4q5hl"]
[ext_resource type="Texture2D" uid="uid://w444vcu8rvae" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_WalkBehind.png" id="6_x36jg"]
[ext_resource type="Texture2D" uid="uid://c5t256wcykb47" path="res://Player/Capricorn/Sprites/GameJam_DevilCapricorn_WalkSide.png" id="7_03beh"]
[sub_resource type="AtlasTexture" id="AtlasTexture_njxhk"]
atlas = ExtResource("2_8qhd4")
region = Rect2(0, 0, 120, 140)
[sub_resource type="AtlasTexture" id="AtlasTexture_bmuvx"]
atlas = ExtResource("2_8qhd4")
region = Rect2(120, 0, 120, 140)
[sub_resource type="AtlasTexture" id="AtlasTexture_14ft5"]
atlas = ExtResource("2_8qhd4")
region = Rect2(240, 0, 120, 140)
[sub_resource type="AtlasTexture" id="AtlasTexture_olmdj"]
atlas = ExtResource("2_8qhd4")
region = Rect2(360, 0, 120, 140)
[sub_resource type="AtlasTexture" id="AtlasTexture_qaudm"]
atlas = ExtResource("3_qftyj")
region = Rect2(0, 0, 120, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_a52sr"]
atlas = ExtResource("3_qftyj")
region = Rect2(120, 0, 120, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_qkrgl"]
atlas = ExtResource("3_qftyj")
region = Rect2(240, 0, 120, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_k5oj5"]
atlas = ExtResource("3_qftyj")
region = Rect2(360, 0, 120, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_6iqcx"]
atlas = ExtResource("4_pwka2")
region = Rect2(0, 0, 113, 142)
[sub_resource type="AtlasTexture" id="AtlasTexture_kiiv3"]
atlas = ExtResource("4_pwka2")
region = Rect2(113, 0, 113, 142)
[sub_resource type="AtlasTexture" id="AtlasTexture_up4ur"]
atlas = ExtResource("4_pwka2")
region = Rect2(226, 0, 113, 142)
[sub_resource type="AtlasTexture" id="AtlasTexture_hvxie"]
atlas = ExtResource("4_pwka2")
region = Rect2(339, 0, 113, 142)
[sub_resource type="AtlasTexture" id="AtlasTexture_vc5hj"]
atlas = ExtResource("5_4q5hl")
region = Rect2(0, 0, 120, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_672u0"]
atlas = ExtResource("5_4q5hl")
region = Rect2(120, 0, 120, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_po3o8"]
atlas = ExtResource("5_4q5hl")
region = Rect2(240, 0, 120, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_v0my0"]
atlas = ExtResource("5_4q5hl")
region = Rect2(360, 0, 120, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_fge82"]
atlas = ExtResource("6_x36jg")
region = Rect2(0, 0, 120, 132)
[sub_resource type="AtlasTexture" id="AtlasTexture_v2d05"]
atlas = ExtResource("6_x36jg")
region = Rect2(120, 0, 120, 132)
[sub_resource type="AtlasTexture" id="AtlasTexture_mkdc6"]
atlas = ExtResource("6_x36jg")
region = Rect2(240, 0, 120, 132)
[sub_resource type="AtlasTexture" id="AtlasTexture_0nnnw"]
atlas = ExtResource("6_x36jg")
region = Rect2(360, 0, 120, 132)
[sub_resource type="AtlasTexture" id="AtlasTexture_sjqet"]
atlas = ExtResource("7_03beh")
region = Rect2(0, 0, 113, 130)
[sub_resource type="AtlasTexture" id="AtlasTexture_l8c3l"]
atlas = ExtResource("7_03beh")
region = Rect2(113, 0, 113, 130)
[sub_resource type="AtlasTexture" id="AtlasTexture_a72tn"]
atlas = ExtResource("7_03beh")
region = Rect2(226, 0, 113, 130)
[sub_resource type="AtlasTexture" id="AtlasTexture_s2v14"]
atlas = ExtResource("7_03beh")
region = Rect2(339, 0, 113, 130)
[sub_resource type="SpriteFrames" id="SpriteFrames_h2iud"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_njxhk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bmuvx")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_14ft5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_olmdj")
}],
"loop": true,
"name": &"AttackBack",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_qaudm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_a52sr")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qkrgl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_k5oj5")
}],
"loop": true,
"name": &"AttackForward",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_6iqcx")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kiiv3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_up4ur")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_hvxie")
}],
"loop": true,
"name": &"AttackSide",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_vc5hj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_672u0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_po3o8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_v0my0")
}],
"loop": true,
"name": &"WalkBack",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_fge82")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_v2d05")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_mkdc6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0nnnw")
}],
"loop": true,
"name": &"WalkForward",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_sjqet")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_l8c3l")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_a72tn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_s2v14")
}],
"loop": true,
"name": &"WalkSide",
"speed": 5.0
}]
[sub_resource type="BoxShape3D" id="BoxShape3D_r4spg"]
size = Vector3(0.856928, 1.65704, 0.82877)
[node name="CapricornP2" type="CharacterBody3D" groups=["Player"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.704732, 0)
motion_mode = 1
script = ExtResource("1_5dwa3")
_fireProjectile = ExtResource("2_241c5")
_altFireProjectile = ExtResource("3_4gj1h")
_fireProjectile = ExtResource("2_241c5")
_altFireProjectile = ExtResource("3_4gj1h")
[node name="Pivot" type="Node3D" parent="."]
[node name="Sprite" type="AnimatedSprite3D" parent="Pivot"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.51107, 0)
billboard = 1
sprite_frames = SubResource("SpriteFrames_h2iud")
animation = &"WalkSide"
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.41651, 0)
shape = SubResource("BoxShape3D_r4spg")
[node name="Area3D" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75657e-15, 1.43031, 0)
disable_mode = 2
collision_layer = 16
collision_mask = 4100
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, 0, 0, 0)
shape = SubResource("BoxShape3D_r4spg")
[connection signal="body_entered" from="Area3D" to="." method="OnHit" flags=18]

View File

@@ -1,148 +0,0 @@
using Godot;
public partial class CapricornP2Controls : P2Controls
{
private AnimatedSprite3D _sprite;
public override void _Ready()
{
_sprite = GetNode<AnimatedSprite3D>("Pivot/Sprite");
CanShoot = true;
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
}
[Export]
private PackedScene _fireProjectile;
[Export]
private PackedScene _altFireProjectile;
[Export]
private float _speed = 3.0f;
public bool IsShooting = false;
private GameManager _gameManager;
public override void _PhysicsProcess(double delta)
{
Velocity = CalculateCharacterMovement(delta);
MoveAndSlide();
}
public override void _UnhandledInput(InputEvent @event)
{
if (Input.IsActionJustPressed("exit"))
GetTree().Quit();
if (Input.IsActionJustPressed($"p2_fire") && CanShoot)
Fire();
if (Input.IsActionJustPressed($"p2_altfire") && CanShoot)
AltFire();
}
private Vector3 CalculateCharacterMovement(double delta)
{
var velocity = Velocity;
var inputDir = Input.GetVector($"p2_left", $"p2_right", $"p2_up", $"p2_down");
var direction = (Transform.Basis * new Vector3(inputDir.X, 0, inputDir.Y)).Normalized();
if (direction != Vector3.Zero)
{
velocity.X = direction.X * _speed;
velocity.Z = direction.Z * _speed;
}
else
{
velocity.X = Mathf.MoveToward(Velocity.X, 0, _speed);
velocity.Z = Mathf.MoveToward(Velocity.Z, 0, _speed);
}
if (IsShooting)
AttackSprite(direction);
else
WalkSprite(direction);
if (!IsShooting && direction.IsEqualApprox(Vector3.Zero))
{
_sprite.Play("WalkForward");
_sprite.Stop();
}
return velocity;
}
private void WalkSprite(Vector3 direction)
{
var roundedDirection = direction.Round();
if (roundedDirection == Vector3.Right)
{
_sprite.Play("WalkSide");
_sprite.FlipH = false;
}
if (roundedDirection == Vector3.Left)
{
_sprite.Play("WalkSide");
_sprite.FlipH = true;
}
if (roundedDirection == Vector3.Forward)
_sprite.Play("WalkForward");
if (roundedDirection == Vector3.Back)
_sprite.Play("WalkBack");
}
private async void Fire()
{
IsShooting = true;
var projectile = _fireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, 0f);
projectile.ParentCharacter = this;
GetParent().AddChild(projectile);
CanShoot = false;
await ToSignal(GetTree().CreateTimer(2.0f), "timeout");
CanShoot = true;
IsShooting = false;
}
private async void AltFire()
{
IsShooting = true;
var projectile = _altFireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, 0f);
projectile.ParentCharacter = this;
GetParent().AddChild(projectile);
CanShoot = false;
await ToSignal(GetTree().CreateTimer(2.0f), "timeout");
CanShoot = true;
IsShooting = false;
}
private void AttackSprite(Vector3 direction)
{
var roundedDirection = direction.Round();
if (roundedDirection == Vector3.Right)
{
_sprite.Play("AttackSide");
_sprite.FlipH = false;
}
if (roundedDirection == Vector3.Left)
{
_sprite.Play("AttackSide");
_sprite.FlipH = true;
}
if (roundedDirection == Vector3.Forward)
_sprite.Play("AttackForward");
if (roundedDirection == Vector3.Back)
_sprite.Play("AttackBack");
if (direction.IsEqualApprox(Vector3.Zero))
_sprite.Play("AttackForward");
}
public new void OnHit(Node3D node)
{
if (this != null)
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, this);
}
}

View File

@@ -1,39 +0,0 @@
[gd_scene load_steps=7 format=3 uid="uid://dfanwejjy3iue"]
[ext_resource type="Script" path="res://Player/Base/P2Controls.cs" id="1_0onpw"]
[ext_resource type="PackedScene" uid="uid://cyn2wn6ffsnu7" path="res://Player/Pisces/Attacks/Single.tscn" id="2_285w6"]
[ext_resource type="PackedScene" uid="uid://bq40xbqibrk1y" path="res://Player/Pisces/Attacks/ShotgunBullet.tscn" id="3_00thi"]
[ext_resource type="PackedScene" uid="uid://yosw0j58nvrf" path="res://Player/Pisces/Models/fwitch.gltf" id="4_hwtlk"]
[sub_resource type="BoxShape3D" id="BoxShape3D_gqlci"]
size = Vector3(3.04879, 3.92906, 2.56521)
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_fqik1"]
radius = 0.704872
height = 1.67894
[node name="PiscesP2" type="CharacterBody3D" groups=["Player"]]
transform = Transform3D(0.33, 0, 0, 0, 0.33, 0, 0, 0, 0.33, 0, 0.533944, 0)
motion_mode = 1
script = ExtResource("1_0onpw")
_fireProjectile = ExtResource("2_285w6")
_altFireProjectile = ExtResource("3_00thi")
[node name="Pivot" type="Node3D" parent="."]
[node name="fwitch" parent="Pivot" instance=ExtResource("4_hwtlk")]
[node name="Area3D" type="Area3D" parent="Pivot"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75657e-15, 0, 0)
collision_layer = 16
collision_mask = 4100
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pivot/Area3D"]
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, -0.0242356, 2.05297, -0.302385)
shape = SubResource("BoxShape3D_gqlci")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.06805, -0.211049)
shape = SubResource("CapsuleShape3D_fqik1")
[connection signal="body_entered" from="Pivot/Area3D" to="." method="OnHit"]

View File

@@ -1,9 +1,9 @@
[gd_scene load_steps=7 format=3 uid="uid://b38hcomu4tpm5"]
[ext_resource type="Script" path="res://Player/Base/P1Controls.cs" id="1_13s3m"]
[ext_resource type="PackedScene" uid="uid://cyn2wn6ffsnu7" path="res://Player/Pisces/Attacks/Single.tscn" id="2_y0wmm"]
[ext_resource type="PackedScene" uid="uid://bq40xbqibrk1y" path="res://Player/Pisces/Attacks/ShotgunBullet.tscn" id="3_p4fqi"]
[ext_resource type="PackedScene" uid="uid://yosw0j58nvrf" path="res://Player/Pisces/Models/fwitch.gltf" id="4_mtwuo"]
[ext_resource type="Script" path="res://Player/Base/Character.cs" id="1_gp8nm"]
[ext_resource type="PackedScene" uid="uid://cyn2wn6ffsnu7" path="res://Player/Pisces/Attacks/Single.tscn" id="2_rsvhh"]
[ext_resource type="PackedScene" uid="uid://bq40xbqibrk1y" path="res://Player/Pisces/Attacks/ShotgunBullet.tscn" id="3_5m8tq"]
[ext_resource type="PackedScene" uid="uid://yosw0j58nvrf" path="res://Player/Pisces/Models/fwitch.gltf" id="4_d60j6"]
[sub_resource type="BoxShape3D" id="BoxShape3D_xynge"]
size = Vector3(3.04879, 3.92906, 2.56521)
@@ -12,16 +12,16 @@ size = Vector3(3.04879, 3.92906, 2.56521)
radius = 0.704872
height = 1.67894
[node name="PiscesP1" type="CharacterBody3D" groups=["Player"]]
[node name="Pisces" type="CharacterBody3D" groups=["Player"]]
transform = Transform3D(0.33, 0, 0, 0, 0.33, 0, 0, 0, 0.33, 0, 0.332056, 0)
motion_mode = 1
script = ExtResource("1_13s3m")
_fireProjectile = ExtResource("2_y0wmm")
_altFireProjectile = ExtResource("3_p4fqi")
script = ExtResource("1_gp8nm")
_fireProjectile = ExtResource("2_rsvhh")
_altFireProjectile = ExtResource("3_5m8tq")
[node name="Pivot" type="Node3D" parent="."]
[node name="fwitch" parent="Pivot" instance=ExtResource("4_mtwuo")]
[node name="fwitch" parent="Pivot" instance=ExtResource("4_d60j6")]
[node name="Area3D" type="Area3D" parent="Pivot"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75657e-15, 0, 0)

View File

@@ -27,7 +27,7 @@ top_level = true
curve = SubResource("Curve3D_7ok4f")
[node name="PathFollow3D" type="PathFollow3D" parent="Path3D"]
transform = Transform3D(-0.999999, 0, 0.000800044, 0, 1, 0, -0.000800044, 0, -0.999999, 0, 1, 0)
transform = Transform3D(-0.999999, 0, 0.000800045, 0, 1, 0, -0.000800045, 0, -0.999999, 0, 1, 0)
loop = false
tilt_enabled = false

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=27 format=3 uid="uid://bgkqfamdiwrrw"]
[ext_resource type="Script" path="res://Player/Base/P1Controls.cs" id="1_wn016"]
[ext_resource type="Script" path="res://Player/Base/Character.cs" id="1_s1hsr"]
[ext_resource type="PackedScene" uid="uid://criqb4bokctlr" path="res://Player/Sagittarius/Attacks/MegamiBeam.tscn" id="2_c3ma7"]
[sub_resource type="BoxShape3D" id="BoxShape3D_te8tc"]
@@ -600,11 +600,11 @@ _surfaces = [{
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_htkik")
[node name="MegamiP1" type="CharacterBody3D" groups=["Player"]]
[node name="Sagittarius" type="CharacterBody3D" groups=["Player"]]
motion_mode = 1
slide_on_ceiling = false
floor_stop_on_slope = false
script = ExtResource("1_wn016")
script = ExtResource("1_s1hsr")
_fireProjectile = ExtResource("2_c3ma7")
_altFireProjectile = ExtResource("2_c3ma7")

View File

@@ -1,37 +0,0 @@
[gd_scene load_steps=7 format=3 uid="uid://cg6hdoeq70ke8"]
[ext_resource type="Script" path="res://Player/Base/P2Controls.cs" id="1_auboe"]
[ext_resource type="PackedScene" uid="uid://cxnek5wgpxbft" path="res://Player/Scorpio/Attacks/CutterShot.tscn" id="2_iw8b0"]
[ext_resource type="PackedScene" uid="uid://cwt4rum7tvyvb" path="res://Player/Scorpio/Attacks/CutterShotAltFire.tscn" id="3_61xde"]
[ext_resource type="PackedScene" uid="uid://dyhimd6qec8fu" path="res://Player/Scorpio/ScorpioAnimated.tscn" id="4_c22td"]
[sub_resource type="BoxShape3D" id="BoxShape3D_wqp0e"]
size = Vector3(0.822782, 0.527059, 0.80108)
[sub_resource type="BoxShape3D" id="BoxShape3D_f8aaj"]
size = Vector3(0.822782, 0.527059, 0.80108)
[node name="ScorpioP2" type="CharacterBody3D" groups=["Player"]]
motion_mode = 1
script = ExtResource("1_auboe")
_fireProjectile = ExtResource("2_iw8b0")
_altFireProjectile = ExtResource("3_61xde")
[node name="Pivot" type="Node3D" parent="."]
[node name="scoprion" parent="Pivot" instance=ExtResource("4_c22td")]
[node name="Area3D" type="Area3D" parent="Pivot"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75657e-15, 0, 0)
collision_layer = 16
collision_mask = 4100
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pivot/Area3D"]
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, 0, 0, 0)
shape = SubResource("BoxShape3D_wqp0e")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0761452, 0)
shape = SubResource("BoxShape3D_f8aaj")
[connection signal="body_entered" from="Pivot/Area3D" to="." method="OnHit"]

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=7 format=3 uid="uid://iempdafdn6ct"]
[ext_resource type="Script" path="res://Player/Base/P1Controls.cs" id="1_o7l70"]
[ext_resource type="PackedScene" uid="uid://dyhimd6qec8fu" path="res://Player/Scorpio/ScorpioAnimated.tscn" id="2_pahgr"]
[ext_resource type="Script" path="res://Player/Base/Character.cs" id="1_gw30u"]
[ext_resource type="PackedScene" uid="uid://dyhimd6qec8fu" path="res://Player/Scorpio/Models/ScorpioAnimated.tscn" id="2_pahgr"]
[ext_resource type="PackedScene" uid="uid://cxnek5wgpxbft" path="res://Player/Scorpio/Attacks/CutterShot.tscn" id="2_uayjr"]
[ext_resource type="PackedScene" uid="uid://cwt4rum7tvyvb" path="res://Player/Scorpio/Attacks/CutterShotAltFire.tscn" id="3_tw078"]
@@ -11,11 +11,11 @@ size = Vector3(0.822782, 0.881451, 0.80108)
[sub_resource type="BoxShape3D" id="BoxShape3D_f8aaj"]
size = Vector3(0.822782, 0.853857, 0.80108)
[node name="ScorpioP1" type="CharacterBody3D" groups=["Player"]]
[node name="Scorpio" type="CharacterBody3D" groups=["Player"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.55696, 0)
motion_mode = 1
slide_on_ceiling = false
script = ExtResource("1_o7l70")
script = ExtResource("1_gw30u")
_fireProjectile = ExtResource("2_uayjr")
_altFireProjectile = ExtResource("3_tw078")