Merge
This commit is contained in:
@@ -1,9 +0,0 @@
|
|||||||
<Project Sdk="Godot.NET.Sdk/4.0.3">
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
|
||||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Scenes\" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<Project Sdk="Godot.NET.Sdk/4.1.0">
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
|
||||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Scenes\" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=5 format=3 uid="uid://ds2y8l8onrs4f"]
|
[gd_scene load_steps=4 format=3 uid="uid://ds2y8l8onrs4f"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://Scripts/Blizzard.cs" id="1_rqtsv"]
|
[ext_resource type="Script" path="res://Scripts/Blizzard.cs" id="1_rqtsv"]
|
||||||
|
|
||||||
@@ -9,24 +9,19 @@ albedo_color = Color(0.137255, 0.447059, 0.796078, 1)
|
|||||||
radial_segments = 4
|
radial_segments = 4
|
||||||
rings = 1
|
rings = 1
|
||||||
|
|
||||||
[sub_resource type="SphereShape3D" id="SphereShape3D_xe0sc"]
|
|
||||||
|
|
||||||
[node name="Blizzard" type="Node3D"]
|
[node name="Blizzard" type="Node3D"]
|
||||||
script = ExtResource("1_rqtsv")
|
script = ExtResource("1_rqtsv")
|
||||||
|
Cooldown = 1.0
|
||||||
_projectileSpeed = 10.0
|
_projectileSpeed = 10.0
|
||||||
|
|
||||||
[node name="RigidBody3D" type="RigidBody3D" parent="."]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||||
collision_layer = 0
|
|
||||||
collision_mask = 16
|
|
||||||
mass = 0.01
|
|
||||||
gravity_scale = 0.0
|
|
||||||
|
|
||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidBody3D"]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.11373, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.11373, 0)
|
||||||
material_override = SubResource("StandardMaterial3D_pd0mo")
|
material_override = SubResource("StandardMaterial3D_pd0mo")
|
||||||
mesh = SubResource("SphereMesh_g0pbs")
|
mesh = SubResource("SphereMesh_g0pbs")
|
||||||
skeleton = NodePath("../..")
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
|
[node name="TimeToLive" type="Timer" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.11958, 0)
|
wait_time = 2.5
|
||||||
shape = SubResource("SphereShape3D_xe0sc")
|
one_shot = true
|
||||||
|
autostart = true
|
||||||
|
|
||||||
|
[connection signal="timeout" from="TimeToLive" to="." method="OnTimeToLiveTimeout"]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=17 format=3 uid="uid://bcsgd8vxy43g2"]
|
[gd_scene load_steps=15 format=3 uid="uid://bcsgd8vxy43g2"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://Scripts/Player.cs" id="1_8dc05"]
|
[ext_resource type="Script" path="res://Scripts/Player.cs" id="1_8dc05"]
|
||||||
[ext_resource type="PackedScene" uid="uid://d20uxkpid4ynd" path="res://Models/vivi1.gltf" id="1_mqt2m"]
|
[ext_resource type="PackedScene" uid="uid://d20uxkpid4ynd" path="res://Models/vivi1.gltf" id="1_mqt2m"]
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
[ext_resource type="Script" path="res://Scripts/CameraSystem.cs" id="3_5ecw2"]
|
[ext_resource type="Script" path="res://Scripts/CameraSystem.cs" id="3_5ecw2"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c13g5orvyhy1p" path="res://Models/moogle.gltf" id="4_dckjs"]
|
[ext_resource type="PackedScene" uid="uid://c13g5orvyhy1p" path="res://Models/moogle.gltf" id="4_dckjs"]
|
||||||
[ext_resource type="Script" path="res://Scripts/NPCFollow.cs" id="4_o5mpp"]
|
[ext_resource type="Script" path="res://Scripts/NPCFollow.cs" id="4_o5mpp"]
|
||||||
|
[ext_resource type="Script" path="res://Scripts/DebugText.cs" id="8_ksx3s"]
|
||||||
[ext_resource type="ArrayMesh" uid="uid://35saq7eyk446" path="res://Models/Cookie.obj" id="8_8xb3w"]
|
[ext_resource type="ArrayMesh" uid="uid://35saq7eyk446" path="res://Models/Cookie.obj" id="8_8xb3w"]
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_8verc"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_8verc"]
|
||||||
@@ -127,3 +128,10 @@ skeleton = NodePath("../..")
|
|||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="CharacterBody3D"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="CharacterBody3D"]
|
||||||
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, -8.04457, 0.690081, -1.66095)
|
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, -8.04457, 0.690081, -1.66095)
|
||||||
shape = SubResource("CapsuleShape3D_y33ih")
|
shape = SubResource("CapsuleShape3D_y33ih")
|
||||||
|
|
||||||
|
[node name="DebugUI" type="Node2D" parent="."]
|
||||||
|
|
||||||
|
[node name="TextEdit" type="TextEdit" parent="DebugUI"]
|
||||||
|
offset_right = 3468.0
|
||||||
|
offset_bottom = 777.0
|
||||||
|
script = ExtResource("8_ksx3s")
|
||||||
|
|||||||
@@ -10,9 +10,16 @@ albedo_color = Color(0.666667, 0, 0.239216, 1)
|
|||||||
[node name="Fireball" type="Node3D"]
|
[node name="Fireball" type="Node3D"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.916843, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.916843, 0)
|
||||||
script = ExtResource("1_4ipg4")
|
script = ExtResource("1_4ipg4")
|
||||||
|
Cooldown = 0.3
|
||||||
_projectileSpeed = 20.0
|
_projectileSpeed = 20.0
|
||||||
|
|
||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.00392, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.00392, 0)
|
||||||
material_override = SubResource("StandardMaterial3D_jxwqo")
|
material_override = SubResource("StandardMaterial3D_jxwqo")
|
||||||
mesh = SubResource("SphereMesh_6bhr7")
|
mesh = SubResource("SphereMesh_6bhr7")
|
||||||
|
|
||||||
|
[node name="TimeToLive" type="Timer" parent="."]
|
||||||
|
one_shot = true
|
||||||
|
autostart = true
|
||||||
|
|
||||||
|
[connection signal="timeout" from="TimeToLive" to="." method="OnTimeToLiveTimeout"]
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
|
using Godot;
|
||||||
|
|
||||||
public partial class Blizzard : Projectile
|
public partial class Blizzard : Projectile
|
||||||
{
|
{
|
||||||
public override void _PhysicsProcess(double delta)
|
public override void _PhysicsProcess(double delta)
|
||||||
{
|
{
|
||||||
Translate(new Godot.Vector3(0, 0, Speed * (float)delta));
|
Translate(new Vector3(0, 0, Speed * (float)delta));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ public partial class Player : CharacterBody3D
|
|||||||
[Export]
|
[Export]
|
||||||
private Array<PackedScene> _projectiles;
|
private Array<PackedScene> _projectiles;
|
||||||
|
|
||||||
|
public bool CanShoot { get; private set; }
|
||||||
|
|
||||||
private Node3D _cameraMount;
|
private Node3D _cameraMount;
|
||||||
private Node3D _pivot;
|
private Node3D _pivot;
|
||||||
private Node3D _camera;
|
private Node3D _camera;
|
||||||
@@ -32,13 +34,14 @@ public partial class Player : CharacterBody3D
|
|||||||
_camera = GetNode<Node3D>("/root/Main/Player/CameraMount/Camera");
|
_camera = GetNode<Node3D>("/root/Main/Player/CameraMount/Camera");
|
||||||
_pivot = GetNode<Node3D>("/root/Main/Player/Pivot");
|
_pivot = GetNode<Node3D>("/root/Main/Player/Pivot");
|
||||||
_weaponType = _projectiles.First();
|
_weaponType = _projectiles.First();
|
||||||
|
CanShoot = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void _Process(double delta)
|
public override void _Process(double delta)
|
||||||
{
|
{
|
||||||
if (Input.IsActionJustPressed("quit"))
|
if (Input.IsActionJustPressed("quit"))
|
||||||
GetTree().Quit();
|
GetTree().Quit();
|
||||||
if (Input.IsActionJustPressed("shoot"))
|
if (Input.IsActionJustPressed("shoot") && CanShoot)
|
||||||
Shoot();
|
Shoot();
|
||||||
if (Input.IsActionJustPressed("switch"))
|
if (Input.IsActionJustPressed("switch"))
|
||||||
SwitchWeaponType();
|
SwitchWeaponType();
|
||||||
@@ -53,19 +56,25 @@ public partial class Player : CharacterBody3D
|
|||||||
MoveAndSlide();
|
MoveAndSlide();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Shoot()
|
private async void Shoot()
|
||||||
{
|
{
|
||||||
GD.Print("Shoot");
|
GD.Print("Shoot");
|
||||||
var projectile = _weaponType.Instantiate<Node3D>();
|
var projectile = _weaponType.Instantiate<Projectile>();
|
||||||
projectile.Position = Position;
|
projectile.Position = Position;
|
||||||
projectile.Rotation = Rotation;
|
projectile.Rotation = Rotation;
|
||||||
GetParent().AddChild(projectile);
|
GetParent().AddChild(projectile);
|
||||||
|
CanShoot = false;
|
||||||
|
await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout");
|
||||||
|
CanShoot = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SwitchWeaponType()
|
private async void SwitchWeaponType()
|
||||||
{
|
{
|
||||||
var index = _projectiles.IndexOf(_weaponType);
|
var index = _projectiles.IndexOf(_weaponType);
|
||||||
_weaponType = _projectiles[(index + 1) % _projectiles.Count];
|
_weaponType = _projectiles[(index + 1) % _projectiles.Count];
|
||||||
|
CanShoot = false;
|
||||||
|
await ToSignal(GetTree().CreateTimer(.5), "timeout");
|
||||||
|
CanShoot = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
public partial class Projectile : Node3D
|
public partial class Projectile : Node3D
|
||||||
{
|
{
|
||||||
|
[Export]
|
||||||
|
public double Cooldown { get; protected set; }
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
private float _projectileSpeed = 0.1f;
|
private float _projectileSpeed = 0.1f;
|
||||||
|
|
||||||
@@ -11,4 +14,9 @@ public partial class Projectile : Node3D
|
|||||||
}
|
}
|
||||||
|
|
||||||
public float Speed { get; private set; }
|
public float Speed { get; private set; }
|
||||||
|
|
||||||
|
public void OnTimeToLiveTimeout()
|
||||||
|
{
|
||||||
|
QueueFree();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
namespace Sandbox.Scripts
|
|
||||||
{
|
|
||||||
internal enum WeaponType
|
|
||||||
{
|
|
||||||
Fire = 0,
|
|
||||||
Blizzard = 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user