diff --git a/Scenes/TestCharacter.tscn b/Scenes/TestCharacter.tscn index 1f260cf..4f15da9 100644 --- a/Scenes/TestCharacter.tscn +++ b/Scenes/TestCharacter.tscn @@ -15,7 +15,6 @@ height = 1.67894 script = ExtResource("1_hddqi") [node name="Pivot" type="Node3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) [node name="fwitch" parent="Pivot" instance=ExtResource("4_n3637")] diff --git a/Scenes/TestEnemy.tscn b/Scenes/TestEnemy.tscn index 0e13d29..d30ac27 100644 --- a/Scenes/TestEnemy.tscn +++ b/Scenes/TestEnemy.tscn @@ -1,41 +1,61 @@ -[gd_scene load_steps=6 format=3 uid="uid://dkjdt7uq3a4j3"] +[gd_scene load_steps=7 format=3 uid="uid://dkjdt7uq3a4j3"] [ext_resource type="ArrayMesh" uid="uid://d3u564wle888o" path="res://Models/TestModels/Ness/nesspoly.obj" id="1_jhe4l"] [ext_resource type="Script" path="res://Scripts/TestEnemy.cs" id="1_m03um"] [ext_resource type="PackedScene" uid="uid://rlxnnw4yay7e" path="res://Scenes/EnemyBullet.tscn" id="2_h68e2"] [ext_resource type="Script" path="res://Scripts/FireAtPlayer.cs" id="3_dhmfs"] +[sub_resource type="Curve3D" id="Curve3D_dgatw"] +_data = { +"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +"tilts": PackedFloat32Array(0, 0, 0) +} +point_count = 3 + [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_eb41r"] radius = 1.0 height = 3.5 [node name="TestEnemy" type="Node3D"] +transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0) -[node name="RigidBody3D" type="RigidBody3D" parent="."] +[node name="Path3D" type="Path3D" parent="."] +curve = SubResource("Curve3D_dgatw") + +[node name="PathFollow3D" type="PathFollow3D" parent="Path3D"] +transform = Transform3D(0.999999, 0, 0, 0, 1, 0, 0, 0, 0.999999, 0, 0, 0) +rotation_mode = 0 +cubic_interp = false +tilt_enabled = false + +[node name="RigidBody3D" type="RigidBody3D" parent="Path3D/PathFollow3D" node_paths=PackedStringArray("_pathFollow")] collision_layer = 0 collision_mask = 2 gravity_scale = 0.0 continuous_cd = true max_contacts_reported = 10 contact_monitor = true +can_sleep = false script = ExtResource("1_m03um") +_speed = 1.0 +_pathFollow = NodePath("..") -[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.51635, 0) -shape = SubResource("CapsuleShape3D_eb41r") - -[node name="Nesspoly" type="MeshInstance3D" parent="RigidBody3D"] +[node name="Nesspoly" type="MeshInstance3D" parent="Path3D/PathFollow3D/RigidBody3D"] transform = Transform3D(7, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0) mesh = ExtResource("1_jhe4l") -skeleton = NodePath("../..") +skeleton = NodePath("../../../..") -[node name="Timer" type="Timer" parent="." node_paths=PackedStringArray("_enemy")] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Path3D/PathFollow3D/RigidBody3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.53674e-07, 1.51635, -9.53674e-07) +shape = SubResource("CapsuleShape3D_eb41r") + +[node name="Timer" type="Timer" parent="Path3D" node_paths=PackedStringArray("_enemy")] wait_time = 3.0 autostart = true script = ExtResource("3_dhmfs") -_enemy = NodePath("../RigidBody3D") +_enemy = NodePath("../PathFollow3D/RigidBody3D") _fireProjectile = ExtResource("2_h68e2") -[connection signal="body_entered" from="RigidBody3D" to="RigidBody3D" method="OnHit"] -[connection signal="tree_exiting" from="RigidBody3D" to="Timer" method="OnDied"] -[connection signal="timeout" from="Timer" to="Timer" method="OnFireAtPlayer"] +[connection signal="body_entered" from="Path3D/PathFollow3D/RigidBody3D" to="Path3D/PathFollow3D/RigidBody3D" method="OnHit"] +[connection signal="tree_exiting" from="Path3D/PathFollow3D/RigidBody3D" to="Path3D/Timer" method="OnDied"] +[connection signal="timeout" from="Path3D/Timer" to="Path3D/Timer" method="OnFireAtPlayer"] diff --git a/Scenes/TestLevel.tscn b/Scenes/TestLevel.tscn index 074dad6..ec40a26 100644 --- a/Scenes/TestLevel.tscn +++ b/Scenes/TestLevel.tscn @@ -33,14 +33,16 @@ script = ExtResource("1_blhn0") _spawnPoint = NodePath("SpawnPoint") [node name="Camera3D" type="Camera3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 0, 1, 0, -1, 0, -0.0769171, 95.2611, -32.0601) +transform = Transform3D(1, 0, 0, 0, 0.496974, 0.867765, 0, -0.867765, 0.496974, 0, 47.9461, -5.79899) +projection = 1 fov = 30.0 +size = 45.0 [node name="DebugCamera" type="Camera3D" parent="."] transform = Transform3D(1, 0, 0, 0, 0.821149, 0.570714, 0, -0.570714, 0.821149, -0.36148, 22.6449, 10.8421) [node name="Fish Witch" parent="." groups=["Player"] instance=ExtResource("1_fwf6c")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 40.7459) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.64605, -18.4987) _speed = 10.0 _fireProjectile = ExtResource("3_lmb02") _altFireProjectile = ExtResource("4_t522c") @@ -62,8 +64,6 @@ shape = SubResource("BoxShape3D_hr26o") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -23.1248, 1.81661, -31.1077) shape = SubResource("BoxShape3D_hr26o") -[node name="levelTEST" parent="StaticBody3D" instance=ExtResource("2_afl3s")] - [node name="CollisionShape3D4" type="CollisionShape3D" parent="StaticBody3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 4.42545) shape = SubResource("BoxShape3D_sjyl3") @@ -85,10 +85,10 @@ transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -48.90 shape = SubResource("BoxShape3D_sjyl3") [node name="TestEnemy" parent="." instance=ExtResource("3_ds7vi")] -transform = Transform3D(0.998405, 0.0226647, 0.0517184, -0.0544217, 0.630486, 0.77429, -0.0150588, -0.775869, 0.630714, -20.5579, 5.52246, -43.2246) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -20.5579, 5.52246, -43.2246) [node name="SpawnPoint" type="Marker3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, -0.757998, 6.71652, -10.4768) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.757998, 6.71652, -10.4768) [node name="StaticBody3D2" type="StaticBody3D" parent="."] collision_layer = 16 @@ -105,3 +105,5 @@ shape = SubResource("CylinderShape3D_fa41j") [node name="Rock3" type="CollisionShape3D" parent="StaticBody3D2"] transform = Transform3D(0.999841, -0.0178538, 0, 0.0178538, 0.999841, 0, 0, 0, 1, -6.84036, 6.33278, -46.1737) shape = SubResource("CylinderShape3D_krlem") + +[node name="levelTEST" parent="." instance=ExtResource("2_afl3s")] diff --git a/Scripts/TestCharacter.cs b/Scripts/TestCharacter.cs index 1114511..cec5179 100644 --- a/Scripts/TestCharacter.cs +++ b/Scripts/TestCharacter.cs @@ -36,13 +36,13 @@ public partial class TestCharacter : CharacterBody3D if (direction != Vector3.Zero) { velocity.X = direction.X * _speed; - velocity.Z = direction.Z * _speed * 2; - GetNode("Pivot").LookAt(Position + direction, Vector3.Forward + Vector3.Up); + velocity.Z = direction.Z * _speed; + GetNode("Pivot").LookAt(Position + direction, Vector3.Up); } else { velocity.X = Mathf.MoveToward(Velocity.X, 0, _speed); - velocity.Z = Mathf.MoveToward(Velocity.Z, 0, _speed * 2); + velocity.Z = Mathf.MoveToward(Velocity.Z, 0, _speed); } return velocity; } diff --git a/Scripts/TestEnemy.cs b/Scripts/TestEnemy.cs index bdaa695..61e2c87 100644 --- a/Scripts/TestEnemy.cs +++ b/Scripts/TestEnemy.cs @@ -1,7 +1,12 @@ using Godot; -public partial class TestEnemy : Node3D +public partial class TestEnemy : RigidBody3D { + [Export] + private float _speed; + [Export] + private PathFollow3D _pathFollow; + public override void _Process(double delta) { var player = GetTree().GetFirstNodeInGroup("Player") as TestCharacter; @@ -9,6 +14,11 @@ public partial class TestEnemy : Node3D LookAt(player.Position); } + public override async void _PhysicsProcess(double delta) + { + _pathFollow.Progress += _speed * (float)delta; + } + public void OnHit(Node node) { GD.Print("Hit detected"); diff --git a/UI/Animations/UIAnimations.tscn b/UI/Animations/UIAnimations.tscn index deb9648..e0a9f7a 100644 --- a/UI/Animations/UIAnimations.tscn +++ b/UI/Animations/UIAnimations.tscn @@ -3,6 +3,110 @@ [ext_resource type="Texture2D" uid="uid://b1ucutlpx3fnp" path="res://UI/INTRO LORE.png" id="1_f4dp3"] [ext_resource type="Texture2D" uid="uid://haxbuoepqn2b" path="res://UI/LEVEL DROP 1.png" id="2_r3e0d"] +[sub_resource type="Animation" id="Animation_3u8q8"] +resource_name = "FirstLevel" +length = 5.0 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("DissolveRect:modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("FirstLevelSplash:visible") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 5), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [true, false] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("LoreSplash:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 5), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [false, false] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("DissolveRect:visible") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0, 5), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [true, false] +} + +[sub_resource type="Animation" id="Animation_qsjit"] +resource_name = "IntroLore" +length = 10.0 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("DissolveRect:modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 3, 7.5, 10), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("DissolveRect:visible") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 10), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [true, false] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("LoreSplash:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 10), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [true, false] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("FirstLevelSplash:visible") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} + [sub_resource type="Animation" id="Animation_fm0re"] resource_name = "RESET" length = 0.1 @@ -71,110 +175,6 @@ tracks/0/keys = { "values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)] } -[sub_resource type="Animation" id="Animation_qsjit"] -resource_name = "IntroLore" -length = 10.0 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("DissolveRect:modulate") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 3, 7.5, 10), -"transitions": PackedFloat32Array(1, 1, 1, 1), -"update": 0, -"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("DissolveRect:visible") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0, 10), -"transitions": PackedFloat32Array(1, 1), -"update": 1, -"values": [true, false] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("LoreSplash:visible") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0, 10), -"transitions": PackedFloat32Array(1, 1), -"update": 1, -"values": [true, false] -} -tracks/3/type = "value" -tracks/3/imported = false -tracks/3/enabled = true -tracks/3/path = NodePath("FirstLevelSplash:visible") -tracks/3/interp = 1 -tracks/3/loop_wrap = true -tracks/3/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [false] -} - -[sub_resource type="Animation" id="Animation_3u8q8"] -resource_name = "FirstLevel" -length = 5.0 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("DissolveRect:modulate") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 1), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("FirstLevelSplash:visible") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0, 5), -"transitions": PackedFloat32Array(1, 1), -"update": 1, -"values": [true, false] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("LoreSplash:visible") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0, 5), -"transitions": PackedFloat32Array(1, 1), -"update": 1, -"values": [false, false] -} -tracks/3/type = "value" -tracks/3/imported = false -tracks/3/enabled = true -tracks/3/path = NodePath("DissolveRect:visible") -tracks/3/interp = 1 -tracks/3/loop_wrap = true -tracks/3/keys = { -"times": PackedFloat32Array(0, 5), -"transitions": PackedFloat32Array(1, 1), -"update": 1, -"values": [true, false] -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_iabf8"] _data = { "FirstLevel": SubResource("Animation_3u8q8"), @@ -198,6 +198,7 @@ mouse_filter = 2 color = Color(0, 0, 0, 1) [node name="AnimationPlayer" type="AnimationPlayer" parent="."] +speed_scale = 0.75 libraries = { "": SubResource("AnimationLibrary_iabf8") } diff --git a/project.godot b/project.godot index 70f5de7..1f9e498 100644 --- a/project.godot +++ b/project.godot @@ -55,7 +55,3 @@ p1_altfire={ "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":2,"canceled":false,"pressed":false,"double_click":false,"script":null) ] } - -[physics] - -common/physics_ticks_per_second=144