Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c1e8235895 | |||
| 1813973daa | |||
| 7b036c5889 |
BIN
assets/greyboxing/Guard tower.glb
Normal file
BIN
assets/greyboxing/Guard tower.glb
Normal file
Binary file not shown.
42
assets/greyboxing/Guard tower.glb.import
Normal file
42
assets/greyboxing/Guard tower.glb.import
Normal file
@@ -0,0 +1,42 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://2huty67y1g5w"
|
||||
path="res://.godot/imported/Guard tower.glb-7dc55f179090ff4a70140c5e94077843.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/greyboxing/Guard tower.glb"
|
||||
dest_files=["res://.godot/imported/Guard tower.glb-7dc55f179090ff4a70140c5e94077843.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/root_script=null
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_name_suffixes=true
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
materials/extract=0
|
||||
materials/extract_format=0
|
||||
materials/extract_path=""
|
||||
_subresources={}
|
||||
gltf/naming_version=2
|
||||
gltf/embedded_image_handling=1
|
||||
@@ -1,59 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://b7w8cn15vsiy0"
|
||||
path="res://.godot/imported/city.blend-135341795722816c412126e50c6067d4.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/greyboxing/city.blend"
|
||||
dest_files=["res://.godot/imported/city.blend-135341795722816c412126e50c6067d4.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/root_script=null
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_name_suffixes=true
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
materials/extract=0
|
||||
materials/extract_format=0
|
||||
materials/extract_path=""
|
||||
_subresources={}
|
||||
blender/nodes/visible=0
|
||||
blender/nodes/active_collection_only=false
|
||||
blender/nodes/punctual_lights=true
|
||||
blender/nodes/cameras=true
|
||||
blender/nodes/custom_properties=true
|
||||
blender/nodes/modifiers=1
|
||||
blender/meshes/colors=false
|
||||
blender/meshes/uvs=true
|
||||
blender/meshes/normals=true
|
||||
blender/meshes/export_geometry_nodes_instances=false
|
||||
blender/meshes/tangents=true
|
||||
blender/meshes/skins=2
|
||||
blender/meshes/export_bones_deforming_mesh_only=false
|
||||
blender/materials/unpack_enabled=true
|
||||
blender/materials/export_materials=1
|
||||
blender/animation/limit_playback=true
|
||||
blender/animation/always_sample=true
|
||||
blender/animation/group_tracks=true
|
||||
gltf/naming_version=2
|
||||
File diff suppressed because one or more lines are too long
0
authoring/.gdignore
Normal file
0
authoring/.gdignore
Normal file
Binary file not shown.
Binary file not shown.
@@ -10,7 +10,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://482s38k0yv35" path="res://maps/Components/stairs.tscn" id="8_pxgdh"]
|
||||
[ext_resource type="PackedScene" uid="uid://cmfagvnymc2yr" path="res://assets/ladder/ladder.fbx" id="9_ukfuy"]
|
||||
[ext_resource type="PackedScene" uid="uid://bod7boex72igr" path="res://assets/ladder/ladder-top.fbx" id="10_wctvs"]
|
||||
[ext_resource type="PackedScene" uid="uid://dyw5lds1w724m" path="res://assets/greyboxing/city_col.tscn" id="11_wctvs"]
|
||||
[ext_resource type="PackedScene" uid="uid://dip6cce5gtwi8" path="res://assets/greyboxing/guard_tower.tscn" id="11_wctvs"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_0xm2m"]
|
||||
sky_horizon_color = Color(0.662243, 0.671743, 0.686743, 1)
|
||||
@@ -1185,5 +1185,5 @@ material = ExtResource("3_cieeo")
|
||||
transform = Transform3D(0, -8, -3.49691e-08, 0, -3.49691e-07, 0.8, -8, 0, 0, 13.4386, 0, -186.439)
|
||||
texture = ExtResource("3_ruo5i")
|
||||
|
||||
[node name="city" parent="." instance=ExtResource("11_wctvs")]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0)
|
||||
[node name="Guard tower" parent="." instance=ExtResource("11_wctvs")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1.5, 0.5)
|
||||
|
||||
@@ -53,6 +53,7 @@ WalkSpeed = 7.5
|
||||
AccelerationAir = 2.0
|
||||
DecelerationAir = 0.1
|
||||
Weight = 5.0
|
||||
MantleTime = 0.2
|
||||
SimpleJumpStartVelocity = 8.0
|
||||
SimpleJumpHangTimeInFrames = 1
|
||||
SimpleJumpGravityLesseningFactor = 2.5
|
||||
@@ -201,6 +202,7 @@ offset_left = 1524.0
|
||||
offset_top = 1.0
|
||||
offset_right = -8.0
|
||||
offset_bottom = 1.0
|
||||
enabled = false
|
||||
initial_node_to_watch = NodePath("../StateChart")
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
|
||||
@@ -310,7 +310,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
// Movement stuff
|
||||
// Getting universal setting from GODOT editor to be in sync
|
||||
_gravity = (float)ProjectSettings.GetSetting("physics/3d/default_gravity");
|
||||
MantleSystem.Init(HeadSystem);
|
||||
MantleSystem.Init();
|
||||
StairsSystem.Init(stairsBelowRayCast3D, stairsAheadRayCast3D, cameraSmooth);
|
||||
DashSystem.Init(HeadSystem, camera, TweenQueueSystem);
|
||||
WeaponSystem.Init(HeadSystem, camera);
|
||||
@@ -438,7 +438,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
{
|
||||
if (CanMantle())
|
||||
{
|
||||
MantleToLocation(MantleSystem.FindMantleInFrontOfPlayer().Unwrap());
|
||||
MantleToLocation(MantleSystem.FindMantleForHeadRotation(HeadSystem.Rotation.Y).Unwrap());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -871,7 +871,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
{
|
||||
// Try mantling but don't know if this is useful
|
||||
if (CanMantle())
|
||||
MantleToLocation(MantleSystem.FindMantleInFrontOfPlayer().Unwrap());
|
||||
MantleToLocation(MantleSystem.FindMantleForHeadRotation(HeadSystem.Rotation.Y).Unwrap());
|
||||
}
|
||||
|
||||
public void FinishPoweredDash()
|
||||
@@ -912,7 +912,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
// Mantling
|
||||
public bool CanMantle()
|
||||
{
|
||||
var mantleLocationResult = MantleSystem.FindMantleInFrontOfPlayer();
|
||||
var mantleLocationResult = MantleSystem.FindMantleForHeadRotation(HeadSystem.Rotation.Y);
|
||||
return mantleLocationResult.IsSome(out _);
|
||||
}
|
||||
public void MantleToLocation(Vector3 location)
|
||||
|
||||
@@ -66,7 +66,7 @@ public partial class DashSystem: Node3D
|
||||
_tweenQueueSystem = tweenQueueSystem;
|
||||
|
||||
_mantleSystem = GetNode<MantleSystem>("MantleSystem");
|
||||
_mantleSystem.Init(this);
|
||||
_mantleSystem.Init();
|
||||
|
||||
_dashTarget = GetNode<MeshInstance3D>("DashTarget");
|
||||
_dashTarget.SetVisible(false);
|
||||
@@ -116,7 +116,8 @@ public partial class DashSystem: Node3D
|
||||
var targetMaterial = (StandardMaterial3D) _dashTarget.GetSurfaceOverrideMaterial(0);
|
||||
targetMaterial.SetAlbedo(targetColor);
|
||||
_dashTarget.SetVisible(true);
|
||||
_dashTarget.SetGlobalPosition(PlannedLocation);
|
||||
var targetLocation = ShouldMantle ? PlannedMantleLocation : PlannedLocation;
|
||||
_dashTarget.SetGlobalPosition(targetLocation);
|
||||
}
|
||||
|
||||
public void StopPreparingDash()
|
||||
|
||||
@@ -35,7 +35,7 @@ mesh = SubResource("SphereMesh_qu4wy")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_v31n3")
|
||||
|
||||
[node name="MantleSystem" parent="." instance=ExtResource("2_pff7b")]
|
||||
MantleEndLocationDistanceFromWall = 0.3
|
||||
MantleEndLocationDistanceFromWall = 0.25
|
||||
MantleHeightCastStart = 2.0
|
||||
|
||||
[node name="DashIndicator" parent="." instance=ExtResource("2_tqt6i")]
|
||||
|
||||
@@ -5,50 +5,40 @@ namespace Movementtests.systems;
|
||||
|
||||
public partial class MantleSystem: Node3D
|
||||
{
|
||||
[Export(PropertyHint.Range, "0,2,0.1,suffix:m,or_greater")]
|
||||
[Export(PropertyHint.Range, "0,2,0.01,suffix:m,or_greater")]
|
||||
public float MantleEndLocationDistanceFromWall { get; set; } = 1f;
|
||||
[Export(PropertyHint.Range, "0,10,0.1,suffix:m,or_greater")]
|
||||
public float MantleHeightCastStart { get; set; } = 2f;
|
||||
[Export(PropertyHint.Range, "0,10,0.01,suffix:m,or_greater")]
|
||||
public float MaxStepHeight = 0.5f;
|
||||
|
||||
private Node3D _head;
|
||||
private ShapeCast3D _wallInFrontCast3D;
|
||||
private ShapeCast3D _mantleCast3D;
|
||||
private RayCast3D _mantleCheckCast3D;
|
||||
|
||||
private Option<Vector3> _mantleLocation;
|
||||
|
||||
public void Init(Node3D head)
|
||||
public void Init()
|
||||
{
|
||||
_head = head;
|
||||
_wallInFrontCast3D = GetNode<ShapeCast3D>("WallInFrontCast3D");
|
||||
_mantleCast3D = GetNode<ShapeCast3D>("MantleCast3D");
|
||||
}
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
public Option<Vector3> FindMantleForHeadRotation(float rotation)
|
||||
{
|
||||
base._PhysicsProcess(delta);
|
||||
|
||||
_wallInFrontCast3D.SetRotation(new Vector3(
|
||||
_wallInFrontCast3D.Rotation.X,
|
||||
_head.Rotation.Y,
|
||||
rotation,
|
||||
_wallInFrontCast3D.Rotation.Z));
|
||||
|
||||
if (!_wallInFrontCast3D.IsColliding())
|
||||
{
|
||||
_mantleLocation = Option<Vector3>.None;
|
||||
return;
|
||||
return Option<Vector3>.None;
|
||||
}
|
||||
|
||||
var collisionPoint = _wallInFrontCast3D.GetCollisionPoint(0);
|
||||
var collisionNormal = _wallInFrontCast3D.GetCollisionNormal(0);
|
||||
_mantleLocation = FindMantleLocationAtPoint(collisionPoint, collisionNormal);
|
||||
}
|
||||
|
||||
public Option<Vector3> FindMantleInFrontOfPlayer()
|
||||
{
|
||||
return _mantleLocation;
|
||||
return FindMantleLocationAtPoint(collisionPoint, collisionNormal);
|
||||
}
|
||||
|
||||
public Option<Vector3> FindMantleLocationAtPoint(Vector3 point, Vector3 wallNormal)
|
||||
@@ -59,8 +49,8 @@ public partial class MantleSystem: Node3D
|
||||
_mantleCast3D.SetGlobalPosition(shapeCastStartLocation);
|
||||
var targetLocation = Vector3.Down * MantleHeightCastStart + Vector3.Up * MaxStepHeight;
|
||||
_mantleCast3D.SetTargetPosition(targetLocation);
|
||||
|
||||
if (_mantleCast3D.IsColliding() && _mantleCast3D.GetCollisionNormal(0).Y > 0.9f)
|
||||
|
||||
if (_mantleCast3D.IsColliding() && _mantleCast3D.GetCollisionNormal(0).Y >= 0.1f)
|
||||
return Option.Some(_mantleCast3D.GetCollisionPoint(0));
|
||||
return Option<Vector3>.None;
|
||||
}
|
||||
|
||||
@@ -218,22 +218,4 @@ public partial class MoveSystem : Node3D
|
||||
var jumpVelocity = jumpForce * effectiveJumpDirection * boost;
|
||||
_parent.Velocity = currentHorizontalVelocity + jumpVelocity;
|
||||
}
|
||||
|
||||
public bool CanMantle()
|
||||
{
|
||||
var mantleLocationResult = _mantleSystem.FindMantleInFrontOfPlayer();
|
||||
return mantleLocationResult.IsSome(out _);
|
||||
}
|
||||
|
||||
public Option<Tween> Mantle()
|
||||
{
|
||||
var mantleLocationResult = _mantleSystem.FindMantleInFrontOfPlayer();
|
||||
if (mantleLocationResult.IsSome(out var mantleLocation))
|
||||
{
|
||||
var duration = 0.1f * mantleLocation.DistanceTo(_parent.Position);
|
||||
var tween = _tweenQueueSystem.TweenToLocation(new TweenQueueSystem.TweenInputs(mantleLocation, duration));
|
||||
return tween.Some();
|
||||
}
|
||||
return Option<Tween>.None;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://ckm3d6k08a72u"]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://ckm3d6k08a72u"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://iii3wfto4t5b" path="res://systems/weapon/WeaponSystem.cs" id="1_csqwk"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbe5f0p6lvqtr" path="res://systems/tween_queue/tween_queue_system.tscn" id="2_x1nha"]
|
||||
@@ -11,7 +11,14 @@
|
||||
height = 1.0
|
||||
radius = 0.1
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_5owyf"]
|
||||
use_z_clip_scale = true
|
||||
z_clip_scale = 0.9
|
||||
use_fov_override = true
|
||||
fov_override = 70.0
|
||||
|
||||
[sub_resource type="CylinderMesh" id="CylinderMesh_x1nha"]
|
||||
material = SubResource("StandardMaterial3D_5owyf")
|
||||
top_radius = 0.0
|
||||
bottom_radius = 0.05
|
||||
height = 1.0
|
||||
|
||||
Reference in New Issue
Block a user