war and murder

This commit is contained in:
2023-09-02 11:25:49 -07:00
parent 3b8e6b34c9
commit 7f7595b06d
8 changed files with 130 additions and 18 deletions

42
Scenes/EnemyBullet.tscn Normal file
View File

@@ -0,0 +1,42 @@
[gd_scene load_steps=6 format=3 uid="uid://rlxnnw4yay7e"]
[ext_resource type="Script" path="res://Scripts/EnemyBullet.cs" id="1_rv13r"]
[ext_resource type="Texture2D" uid="uid://dpln8jwtpqru0" path="res://Textures/Projectiles/fireball.png" id="2_is81v"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_phgri"]
albedo_color = Color(0.584314, 0.0352941, 0.141176, 1)
[sub_resource type="SphereMesh" id="SphereMesh_wuk0e"]
material = SubResource("StandardMaterial3D_phgri")
[sub_resource type="SphereShape3D" id="SphereShape3D_rokeu"]
radius = 0.440093
[node name="TestBullet" type="Node3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.538645, 0)
script = ExtResource("1_rv13r")
_projectileSpeed = 20.0
[node name="RigidBody3D" type="RigidBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.694675, 0)
collision_layer = 4
collision_mask = 0
gravity_scale = 0.0
custom_integrator = true
continuous_cd = true
max_contacts_reported = 10
contact_monitor = true
can_sleep = false
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidBody3D"]
visible = false
mesh = SubResource("SphereMesh_wuk0e")
skeleton = NodePath("../..")
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0905764, 0, 0)
shape = SubResource("SphereShape3D_rokeu")
[node name="Sprite3D" type="Sprite3D" parent="RigidBody3D"]
axis = 1
texture = ExtResource("2_is81v")

View File

@@ -1,13 +1,17 @@
[gd_scene load_steps=6 format=3 uid="uid://b38hcomu4tpm5"]
[gd_scene load_steps=7 format=3 uid="uid://b38hcomu4tpm5"]
[ext_resource type="Script" path="res://Scripts/TestCharacter.cs" id="1_hddqi"]
[ext_resource type="PackedScene" uid="uid://bq40xbqibrk1y" path="res://Scenes/ShotgunBullet.tscn" id="3_5h4r7"]
[ext_resource type="PackedScene" uid="uid://si4byubqnng4" path="res://Scenes/TestBullet.tscn" id="3_ojvu2"]
[ext_resource type="PackedScene" uid="uid://yosw0j58nvrf" path="res://Models/Characters/fwitch.gltf" id="4_n3637"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ayco3"]
radius = 0.980738
height = 3.77708
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_fqik1"]
radius = 0.913688
height = 1.82738
radius = 0.704872
height = 1.67894
[node name="Character" type="CharacterBody3D"]
script = ExtResource("1_hddqi")
@@ -15,11 +19,21 @@ _speed = 15.0
_fireProjectile = ExtResource("3_ojvu2")
_altFireProjectile = ExtResource("3_5h4r7")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, 0, 2.10024, -0.247215)
visible = false
shape = SubResource("CapsuleShape3D_fqik1")
[node name="Pivot" type="Node3D" parent="."]
[node name="fwitch" parent="Pivot" instance=ExtResource("4_n3637")]
[node name="Area3D" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75657e-15, 0, 0)
collision_layer = 0
collision_mask = 4
[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.0242356, 2.05297, -0.302385)
shape = SubResource("CapsuleShape3D_ayco3")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, 0, 2.10024, -0.247215)
shape = SubResource("CapsuleShape3D_fqik1")
[connection signal="body_entered" from="Area3D" to="." method="OnHit"]

View File

@@ -2,6 +2,13 @@ using Godot;
public partial class TestEnemy : Node3D
{
public override void _Process(double delta)
{
var player = GetTree().GetFirstNodeInGroup("Player") as TestCharacter;
if (player != null)
LookAt(player.Position);
}
public void OnHit(Node node)
{
GD.Print("Hit detected");

View File

@@ -1,14 +1,15 @@
[gd_scene load_steps=4 format=3 uid="uid://dkjdt7uq3a4j3"]
[gd_scene load_steps=6 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://Scenes/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="CapsuleShape3D" id="CapsuleShape3D_eb41r"]
radius = 1.0
height = 3.5
[node name="TestEnemy" type="Node3D"]
script = ExtResource("1_m03um")
[node name="RigidBody3D" type="RigidBody3D" parent="."]
collision_layer = 0
@@ -17,6 +18,7 @@ gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 10
contact_monitor = true
script = ExtResource("1_m03um")
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.51635, 0)
@@ -27,4 +29,13 @@ transform = Transform3D(7, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0)
mesh = ExtResource("1_jhe4l")
skeleton = NodePath("../..")
[connection signal="body_entered" from="RigidBody3D" to="." method="OnHit"]
[node name="Timer" type="Timer" parent="." node_paths=PackedStringArray("_enemy")]
wait_time = 3.0
autostart = true
script = ExtResource("3_dhmfs")
_enemy = NodePath("../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"]

View File

@@ -27,14 +27,13 @@ radius = 2.06347
[node name="Level" type="Node3D"]
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -2.98023e-08, 1, 0, -1, -2.98023e-08, -0.0769171, 95.2611, -32.0601)
transform = Transform3D(1, 0, 0, 0, 0, 1, 0, -1, 0, -0.0769171, 95.2611, -32.0601)
fov = 30.0
[node name="DebugCamera" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.821149, 0.570714, 0, -0.570714, 0.821149, -0.36148, 17.9168, 0.864431)
visible = false
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="." instance=ExtResource("1_fwf6c")]
[node name="Fish Witch" parent="." groups=["Player"] instance=ExtResource("1_fwf6c")]
transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 5.26, 5.13104, -7.959)
_speed = 10.0
@@ -66,11 +65,11 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.650528, -0.488932, -78.351
shape = SubResource("BoxShape3D_sjyl3")
[node name="CollisionShape3D6" type="CollisionShape3D" parent="StaticBody3D"]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 46.5847, -0.977863, -52.3885)
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 46.5847, -0.977863, -37.8814)
shape = SubResource("BoxShape3D_sjyl3")
[node name="CollisionShape3D7" type="CollisionShape3D" parent="StaticBody3D"]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -48.9058, -1.95573, -5.80381)
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -48.9058, -1.95573, -38.8643)
shape = SubResource("BoxShape3D_sjyl3")
[node name="CollisionShape3D8" type="CollisionShape3D" parent="StaticBody3D"]
@@ -90,4 +89,4 @@ transform = Transform3D(0.999841, -0.0178538, 0, 0.0178538, 0.999841, 0, 0, 0, 1
shape = SubResource("CylinderShape3D_krlem")
[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, 4.87709, -43.2246)
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)