Init the godot project

- Add a first-view controller and a bunch of things
- First shooting implementation
- Remove heavy models and clean the project up
This commit is contained in:
2025-01-16 15:20:04 +01:00
parent 927d6b560c
commit 2577e952d6
220 changed files with 16443 additions and 17 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

22
scenes/maps/el_test.gd Normal file
View File

@ -0,0 +1,22 @@
extends Node3D
var player_side: String
@onready var intro_camera = $Intro/CameraMount/IntroCamera
@onready var intro_view_port = $Intro/CameraMount/IntroCamera/SubViewportContainer/SubViewport
@onready var spawns = $Spawns
@onready var root = $'.'
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var char : Node3D = null
var red_spawn: Node3D = $Spawns/Blue/SpawnArea
var position := red_spawn.global_position
char = ResourceLoader.load("res://scenes/utils/character.tscn").instantiate()
char.global_position = position
root.add_child(char)
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

26
scenes/maps/el_test.tscn Normal file
View File

@ -0,0 +1,26 @@
[gd_scene load_steps=3 format=3 uid="uid://c1v6kb00y77ij"]
[ext_resource type="Script" path="res://scenes/maps/el_test.gd" id="1_d5e7i"]
[ext_resource type="PackedScene" uid="uid://clp0pm3nxovxc" path="res://assets/models/maps/el_test.glb" id="2_cnkr5"]
[node name="ElTest" type="Node3D"]
script = ExtResource("1_d5e7i")
[node name="Light" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.508004, 0.861354, 0, -0.861354, 0.508004, 0, 2.97783, 2.62213)
[node name="Map" parent="." instance=ExtResource("2_cnkr5")]
[node name="Spawns" type="Node3D" parent="."]
[node name="Red" type="Node3D" parent="Spawns"]
[node name="SpawnArea" type="CSGBox3D" parent="Spawns/Red"]
transform = Transform3D(12.6683, 0, 0, 0, 1.0986, 0, 0, 0, 7.83287, -24.5455, 1.59351, 1.14462)
size = Vector3(0.100647, 1, 6.02112)
[node name="Blue" type="Node3D" parent="Spawns"]
[node name="SpawnArea" type="CSGBox3D" parent="Spawns/Blue"]
transform = Transform3D(5.70162, 0, 0, 0, 1, 0, 0, 0, 7.97817, 21.2099, 1.78438, 1.23551)
size = Vector3(0.484497, 1, 5.99213)

View File

@ -0,0 +1,24 @@
extends Node3D
var target_node_name: String = "TargetNode" # Name of the Node3D to detect
@onready var raycast : RayCast3D = $CameraMount/Camera3D/RayCast3D
@onready var camera : Camera3D = $CameraMount/Camera3D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var blue := $ChooseTeam/Blue
var red := $ChooseTeam/Read
if
if raycast.is_colliding():
var collider = raycast.get_collider()
if collider and collider.name == target_node_name:
print("Mouse is pointing at:", collider.name)
else:
print("Mouse is not pointing at the target node.")
else:
print("Mouse is not pointing at anything.")

76
scenes/maps/test_map.tscn Normal file
View File

@ -0,0 +1,76 @@
[gd_scene load_steps=14 format=3 uid="uid://hivk5ek6u887"]
[ext_resource type="Texture2D" uid="uid://c5uytbu1wc1bq" path="res://addons/kenney_prototype_textures/orange/texture_09.png" id="1_llm1c"]
[ext_resource type="Texture2D" uid="uid://e4nd8b6f0tw7" path="res://addons/kenney_prototype_textures/dark/texture_04.png" id="2_k2arh"]
[ext_resource type="PackedScene" uid="uid://1j5ajc26w5xk" path="res://scenes/utils/character_bak.tscn" id="3_6anfg"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bcdcw"]
albedo_texture = ExtResource("1_lae2b")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_p4psn"]
albedo_texture = ExtResource("2_7newm")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0jiki"]
albedo_texture = ExtResource("2_7newm")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1pwnn"]
albedo_texture = ExtResource("2_7newm")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1yo6k"]
albedo_texture = ExtResource("2_7newm")
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_3aaun"]
[sub_resource type="Sky" id="Sky_xco2g"]
sky_material = SubResource("ProceduralSkyMaterial_3aaun")
[sub_resource type="Environment" id="Environment_5t2t5"]
background_mode = 2
sky = SubResource("Sky_xco2g")
sdfgi_enabled = true
fog_light_energy = 0.52
fog_density = 0.1387
volumetric_fog_enabled = true
volumetric_fog_density = 0.0
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_32hnm"]
[node name="TestMap" type="Node3D"]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 50, 0)
[node name="World" type="Node3D" parent="."]
[node name="Base" type="Node3D" parent="World"]
[node name="Floor" type="CSGBox3D" parent="World/Base"]
use_collision = true
size = Vector3(100, 1, 100)
[node name="Wall_1" type="CSGBox3D" parent="World/Base"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 50, 0, 0)
material_override = SubResource("StandardMaterial3D_p4psn")
use_collision = true
size = Vector3(1, 20, 100)
[node name="Wall_2" type="CSGBox3D" parent="World/Base"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -50, 0, 0)
material_override = SubResource("StandardMaterial3D_0jiki")
use_collision = true
size = Vector3(1, 20, 100)
[node name="Wall_3" type="CSGBox3D" parent="World/Base"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 50)
material_override = SubResource("StandardMaterial3D_1pwnn")
use_collision = true
size = Vector3(100, 20, 1)
[node name="Wall_4" type="CSGBox3D" parent="World/Base"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -50)
material_override = SubResource("StandardMaterial3D_1yo6k")
use_collision = true
size = Vector3(100, 20, 1)
[node name="Character" parent="World" instance=ExtResource("3_6anfg")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 14.6432, 0)

File diff suppressed because one or more lines are too long

31
scenes/utils/Menu.tscn Normal file
View File

@ -0,0 +1,31 @@
[gd_scene load_steps=2 format=3 uid="uid://da7ymbxyg7miy"]
[ext_resource type="Script" path="res://scenes/utils/menu.gd" id="1_5mxqd"]
[node name="Menu" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_5mxqd")
[node name="Host" type="Button" parent="."]
layout_mode = 0
offset_left = 113.0
offset_top = 66.0
offset_right = 223.0
offset_bottom = 141.0
text = "Host"
[node name="Join" type="Button" parent="."]
layout_mode = 0
offset_left = 115.0
offset_top = 148.0
offset_right = 224.0
offset_bottom = 220.0
text = "Join"
[connection signal="pressed" from="Host" to="." method="_on_host_pressed"]
[connection signal="pressed" from="Join" to="." method="_on_join_pressed"]

102
scenes/utils/body.tscn Normal file
View File

@ -0,0 +1,102 @@
[gd_scene load_steps=2 format=3 uid="uid://ceywbkneyatpw"]
[ext_resource type="PackedScene" uid="uid://cn7ty4xcbiqaf" path="res://assets/models/character/character.glb" id="1_ldvdo"]
[node name="character" instance=ExtResource("1_ldvdo")]
[node name="Skeleton3D" parent="Armature" index="0"]
bones/0/position = Vector3(0.27864, 0.0511703, -94.5392)
bones/0/rotation = Quaternion(-0.604149, -0.348807, 0.29163, 0.654439)
bones/1/rotation = Quaternion(-0.0341781, 0.0566953, 0.0240948, 0.997515)
bones/2/rotation = Quaternion(0.0232735, 0.0685228, 0.0060157, 0.99736)
bones/3/rotation = Quaternion(0.0239388, 0.0686278, 0.00447139, 0.997345)
bones/4/rotation = Quaternion(0.160264, 0.0650181, -0.0283947, 0.984521)
bones/5/rotation = Quaternion(0.00615673, 0.173887, 0.0695452, 0.982288)
bones/7/rotation = Quaternion(-0.573553, -0.410703, 0.634322, -0.316221)
bones/8/position = Vector3(-5.17998e-07, 12.6417, 7.24198e-06)
bones/8/rotation = Quaternion(0.172527, -0.218225, 0.436503, 0.855615)
bones/9/position = Vector3(5.25072e-07, 21.8647, -1.64733e-06)
bones/9/rotation = Quaternion(0.0784446, -0.00225524, 0.650572, 0.755379)
bones/10/position = Vector3(-6.68945e-06, 25.0647, 1.19204e-06)
bones/10/rotation = Quaternion(-0.166441, -0.334552, -0.373809, 0.848905)
bones/11/rotation = Quaternion(0.0956501, -0.0429417, 0.168576, 0.980097)
bones/12/position = Vector3(-0.347165, 3.29954, -8.22866e-06)
bones/12/rotation = Quaternion(-0.0984275, 0.0713401, 0.117913, 0.985555)
bones/13/position = Vector3(0.410877, 3.32378, 6.80089e-06)
bones/13/rotation = Quaternion(-0.0316813, 0.0203845, 0.14611, 0.988551)
bones/14/position = Vector3(-0.0637035, 2.82069, -2.79248e-05)
bones/15/position = Vector3(-3.18417, 9.19059, 0.0928621)
bones/15/rotation = Quaternion(0.259408, 0.000923331, 0.03495, 0.965135)
bones/16/position = Vector3(-0.0111496, 3.04017, 1.97763e-06)
bones/16/rotation = Quaternion(0.5136, 0.000858785, -0.035911, 0.857278)
bones/17/position = Vector3(0.000624061, 2.89652, 1.03269e-05)
bones/17/rotation = Quaternion(0.207564, -0.000416576, -0.0132767, 0.978131)
bones/18/position = Vector3(0.0105192, 2.56021, 2.20537e-05)
bones/19/position = Vector3(-0.955101, 9.47556, -0.253679)
bones/19/rotation = Quaternion(0.342569, -0.00821127, 0.050494, 0.938099)
bones/20/position = Vector3(-0.00172836, 3.39762, 6.92725e-06)
bones/20/rotation = Quaternion(0.50153, -0.000192444, -0.0367875, 0.864358)
bones/21/position = Vector3(0.00409269, 3.19824, 4.93312e-07)
bones/21/rotation = Quaternion(0.335944, -8.39514e-05, -0.0261373, 0.941519)
bones/22/position = Vector3(-0.00237793, 2.99991, 9.83477e-06)
bones/23/position = Vector3(1.01976, 9.84634, -0.193835)
bones/23/rotation = Quaternion(0.409699, -0.0244552, 0.0804267, 0.908339)
bones/24/position = Vector3(-0.0118652, 3.04989, 1.77043e-06)
bones/24/rotation = Quaternion(0.509526, 0.000396417, -0.0340288, 0.859782)
bones/25/position = Vector3(0.00632149, 2.85057, -3.69064e-06)
bones/25/rotation = Quaternion(0.173468, -0.000380233, -0.0125006, 0.98476)
bones/26/position = Vector3(0.00549984, 2.53632, -6.19888e-06)
bones/27/rotation = Quaternion(0.311367, -0.0292845, 0.133976, 0.940342)
bones/28/position = Vector3(-0.00902244, 2.81508, -2.19431e-06)
bones/28/rotation = Quaternion(0.492928, 0.00128819, -0.0329787, 0.869444)
bones/29/position = Vector3(-0.00492001, 2.3477, 1.43756e-06)
bones/29/rotation = Quaternion(0.273847, -0.000518838, -0.0143469, 0.961666)
bones/30/position = Vector3(0.0139517, 2.09557, -1.09673e-05)
bones/31/rotation = Quaternion(0.494488, -0.36288, 0.60222, 0.511009)
bones/32/position = Vector3(4.22225e-06, 12.6416, -1.10171e-05)
bones/32/rotation = Quaternion(0.37955, 0.0300409, -0.743407, 0.549896)
bones/33/position = Vector3(-5.33444e-06, 21.8736, 5.47588e-06)
bones/33/rotation = Quaternion(0.0292594, 0.00337502, -0.249351, 0.967965)
bones/34/position = Vector3(7.18826e-06, 25.0758, -4.14478e-06)
bones/34/rotation = Quaternion(-0.195169, 0.329259, 0.200115, 0.901916)
bones/35/rotation = Quaternion(0.296356, -0.111756, -0.179233, 0.931429)
bones/36/position = Vector3(0.456064, 3.20386, -8.12512e-06)
bones/36/rotation = Quaternion(-0.0614832, -0.184996, 0.128837, 0.972315)
bones/37/position = Vector3(-0.244571, 3.32856, -1.36769e-05)
bones/37/rotation = Quaternion(-0.158524, -0.0307899, 0.465163, 0.870371)
bones/38/position = Vector3(-0.211511, 3.05178, -1.10865e-05)
bones/39/position = Vector3(3.12053, 9.18468, 0.0421683)
bones/39/rotation = Quaternion(0.204655, -0.00671871, -0.018747, 0.978632)
bones/40/position = Vector3(-0.00222988, 3.1519, 9.17081e-06)
bones/40/rotation = Quaternion(0.421442, 0.00103411, 0.0148947, 0.906733)
bones/41/position = Vector3(-0.0128262, 2.89937, 1.74316e-06)
bones/41/rotation = Quaternion(0.432079, -0.000288449, 0.0214826, 0.90158)
bones/42/position = Vector3(0.0150719, 2.69096, 2.13236e-05)
bones/43/position = Vector3(0.930105, 9.47023, -0.320952)
bones/43/rotation = Quaternion(0.418293, -0.0532811, 0.0815441, 0.903074)
bones/44/position = Vector3(-0.000950336, 3.40719, 1.28055e-05)
bones/44/rotation = Quaternion(0.827156, 0.000328466, 0.0351444, 0.560872)
bones/45/rotation = Quaternion(0.163151, -2.80439e-05, 0.00763214, 0.986572)
bones/46/position = Vector3(0.00259387, 3.02687, 6.4373e-06)
bones/47/position = Vector3(-0.989343, 9.67951, 0.0239833)
bones/47/rotation = Quaternion(0.465976, -0.0287381, 0.0115431, 0.884255)
bones/48/position = Vector3(0.0445154, 3.01189, -1.12322e-06)
bones/48/rotation = Quaternion(0.755862, -0.00557906, 0.0184576, 0.654447)
bones/49/position = Vector3(0.00265485, 2.88887, 2.71164e-06)
bones/49/rotation = Quaternion(0.418283, 0.00289807, 0.00376654, 0.908304)
bones/50/position = Vector3(-0.0471536, 2.55138, -1.09673e-05)
bones/51/position = Vector3(-3.06127, 8.97437, 0.211041)
bones/51/rotation = Quaternion(0.478424, -0.00936341, -0.0220554, 0.877802)
bones/52/position = Vector3(0.0111583, 2.80333, 8.22487e-06)
bones/52/rotation = Quaternion(0.585571, -0.00241607, 0.0190579, 0.810394)
bones/53/position = Vector3(0.0101426, 2.38341, 9.88739e-06)
bones/53/rotation = Quaternion(0.436353, 0.00101625, 0.00774158, 0.899742)
bones/54/position = Vector3(-0.0213175, 2.19929, 1.97887e-05)
bones/55/rotation = Quaternion(0.126585, 0.224655, 0.950727, -0.17212)
bones/56/rotation = Quaternion(-0.243967, -0.0859724, -0.00367405, 0.965958)
bones/57/rotation = Quaternion(0.435121, -0.0653114, -0.00439514, 0.897989)
bones/58/rotation = Quaternion(0.351876, -0.0232251, 0.00873377, 0.935718)
bones/60/rotation = Quaternion(-0.124929, 0.0737917, 0.986052, 0.0815441)
bones/61/rotation = Quaternion(-0.156, -0.0709137, 0.0190794, 0.985024)
bones/62/rotation = Quaternion(0.496512, 0.112741, 0.0299064, 0.860157)
bones/63/rotation = Quaternion(0.352338, 0.0234385, -0.00882726, 0.935538)

135
scenes/utils/character.tscn Normal file
View File

@ -0,0 +1,135 @@
[gd_scene load_steps=11 format=3 uid="uid://ccm77j5rkh21w"]
[ext_resource type="Script" path="res://scripts/character_controller.gd" id="1_sue4n"]
[ext_resource type="PackedScene" uid="uid://ceywbkneyatpw" path="res://scenes/utils/body.tscn" id="2_2couv"]
[ext_resource type="PackedScene" uid="uid://bmqutwuj28san" path="res://scenes/utils/view_model_camera.tscn" id="4_al83x"]
[ext_resource type="Script" path="res://scenes/weapon/pistol.gd" id="4_uwcjh"]
[ext_resource type="PackedScene" uid="uid://d21giy40pnjhe" path="res://scenes/weapon/pistol.tscn" id="5_6k7rq"]
[ext_resource type="PackedScene" path="res://assets/models/character/character.glb" id="8_42pl8"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_adkee"]
radius = 0.368364
height = 1.0
[sub_resource type="Animation" id="Animation_rf8fv"]
resource_name = "Crouch"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:shape:height")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [1.8, 1.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = false
tracks/1/path = NodePath(".:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 0.9, 0), Vector3(0, 0.5, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("../UpperTorso:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 1.2734, 0), Vector3(0, 0.639947, 0)]
}
[sub_resource type="Animation" id="Animation_mgw3s"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:shape:height")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [1.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 0.9, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("../UpperTorso:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 1.2734, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_mnir7"]
_data = {
"Crouch": SubResource("Animation_rf8fv"),
"RESET": SubResource("Animation_mgw3s")
}
[node name="Character" type="Node3D"]
[node name="CharacterBody3D" type="CharacterBody3D" parent="." node_paths=PackedStringArray("ANIMATION_PLAYER")]
script = ExtResource("1_sue4n")
ANIMATION_PLAYER = NodePath("AnimationPlayer")
[node name="CollisionShape3D" type="CollisionShape3D" parent="CharacterBody3D"]
transform = Transform3D(1, 0, 0, 0, 1.66022, 0, 0, 0, 0.967678, 0, 0.9, 0)
shape = SubResource("CapsuleShape3D_adkee")
[node name="character" parent="CharacterBody3D" instance=ExtResource("2_2couv")]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
visible = false
[node name="UpperTorso" type="CSGSphere3D" parent="CharacterBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.2734, 0)
radius = 0.001
[node name="ViewModelCamera" parent="CharacterBody3D/UpperTorso" instance=ExtResource("4_al83x")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00122696, 0.093623, -0.179357)
script = ExtResource("4_uwcjh")
[node name="Pistol" parent="CharacterBody3D/UpperTorso/ViewModelCamera" instance=ExtResource("5_6k7rq")]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.0287516, -0.136104, -0.276055)
visible = false
script = null
[node name="AnimationPlayer" type="AnimationPlayer" parent="CharacterBody3D"]
root_node = NodePath("../CollisionShape3D")
libraries = {
"": SubResource("AnimationLibrary_mnir7")
}
[node name="RealBody" type="Node3D" parent="CharacterBody3D"]
visible = false
[node name="character2" parent="CharacterBody3D/RealBody" instance=ExtResource("8_42pl8")]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.0147014)

View File

@ -0,0 +1,42 @@
[gd_scene load_steps=7 format=3 uid="uid://1j5ajc26w5xk"]
[ext_resource type="Script" path="res://scripts/character_controller.gd" id="1_vb71f"]
[ext_resource type="Texture2D" uid="uid://d1nfjip21kjpu" path="res://addons/kenney_prototype_textures/orange/texture_13.png" id="2_j4i2j"]
[ext_resource type="Script" path="res://scenes/weapon/pistol.gd" id="3_gblkg"]
[ext_resource type="PackedScene" uid="uid://d21giy40pnjhe" path="res://scenes/weapon/pistol.tscn" id="4_xw0oh"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_m6bjf"]
albedo_texture = ExtResource("2_j4i2j")
[sub_resource type="CylinderShape3D" id="CylinderShape3D_1sre5"]
radius = 0.227448
[node name="Character" type="Node3D"]
[node name="CharacterBody3D" type="CharacterBody3D" parent="."]
script = ExtResource("1_vb71f")
[node name="Body" type="CSGCylinder3D" parent="CharacterBody3D"]
transform = Transform3D(0.999983, 0.00579446, 0, -0.00579446, 0.999983, 0, 0, 0, 1, 0, 0.975222, 0)
material_override = SubResource("StandardMaterial3D_m6bjf")
radius = 0.492
[node name="UpperTorso" type="CSGSphere3D" parent="CharacterBody3D/Body"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.298181, 0)
radius = 0.001
[node name="CameraMount" type="Node3D" parent="CharacterBody3D/Body/UpperTorso"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0214237, -0.151336, -0.0131589)
[node name="Camera" type="Camera3D" parent="CharacterBody3D/Body/UpperTorso/CameraMount"]
transform = Transform3D(0.999902, 0.0139622, 0, -0.0139622, 0.999902, 0, 0, 0, 0.999999, 0, 0, 0)
current = true
script = ExtResource("3_gblkg")
[node name="Pistol" parent="CharacterBody3D/Body/UpperTorso/CameraMount/Camera" instance=ExtResource("4_xw0oh")]
transform = Transform3D(-0.999901, -0.0139622, -8.74142e-08, -0.0139621, 0.999901, -1.22061e-09, 8.74228e-08, 0, -1, 0.346313, -0.1921, -0.617977)
script = null
[node name="CollisionShape3D" type="CollisionShape3D" parent="CharacterBody3D"]
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0.981342, 0)
shape = SubResource("CylinderShape3D_1sre5")

View File

@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://bo8jemggniu3c"]
[ext_resource type="PackedScene" uid="uid://c1v6kb00y77ij" path="res://scenes/maps/el_test.tscn" id="1_25xw6"]
[node name="ChooseTeam" type="Node3D"]
[node name="ElTest" parent="." instance=ExtResource("1_25xw6")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.05481, 0, 3.71705)

22
scenes/utils/menu.gd Normal file
View File

@ -0,0 +1,22 @@
extends Control
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
var peer = ENetMultiplayerPeer.new()
func _on_host_pressed() -> void:
get_tree().change_scene_to_file("res://scenes/maps/el_test.tscn")
func _on_join_pressed() -> void:
print("join")

View File

@ -0,0 +1,19 @@
[gd_scene format=3 uid="uid://cf4pgjll6xhoh"]
[node name="ChooseSide" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Blue" type="Button" parent="."]
layout_mode = 0
offset_right = 8.0
offset_bottom = 8.0
[node name="Red" type="Button" parent="Blue"]
layout_mode = 0
offset_right = 8.0
offset_bottom = 8.0

File diff suppressed because one or more lines are too long

27
scenes/weapon/bullet.gd Normal file
View File

@ -0,0 +1,27 @@
extends Node3D
const SPEED = 100
@onready var mesh = $MeshInstance3D
@onready var ray = $RayCast3D
@onready var particles = $GPUParticles3D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
position += transform.basis * Vector3(0, 0, SPEED) * delta
ray.collision_mask = 1
ray.enabled = 1
if ray.is_colliding():
mesh.visible = false
particles.emitting = true
await get_tree().create_timer(1.0).timeout
queue_free()
func _on_timer_timeout():
queue_free()

56
scenes/weapon/bullet.tscn Normal file
View File

@ -0,0 +1,56 @@
[gd_scene load_steps=7 format=3 uid="uid://b0agqeg53tey5"]
[ext_resource type="Script" path="res://scenes/weapon/bullet.gd" id="1_th28m"]
[sub_resource type="BoxMesh" id="BoxMesh_vxst2"]
size = Vector3(0.2, 0.2, 0.5)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_p8o05"]
albedo_color = Color(0.894987, 0.000702324, 0.905119, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ynv38"]
albedo_color = Color(0.929412, 0, 0, 1)
emission_enabled = true
emission = Color(0.886321, 0.78611, 0.23507, 1)
emission_energy_multiplier = 7.71
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_58cgi"]
direction = Vector3(0, 0, 1)
spread = 22.5
initial_velocity_min = 3.47
initial_velocity_max = 5.0
gravity = Vector3(0, -19.6, 0)
linear_accel_min = -6.67
linear_accel_max = 6.67
[sub_resource type="BoxMesh" id="BoxMesh_mfkmi"]
size = Vector3(0.05, 0.05, 0.05)
[node name="Bullet" type="Node3D"]
script = ExtResource("1_th28m")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(0.663102, 0, 0, 0, 0.601826, 0, 0, 0, 0.58984, 0, 0, 0)
mesh = SubResource("BoxMesh_vxst2")
surface_material_override/0 = SubResource("StandardMaterial3D_p8o05")
[node name="RayCast3D" type="RayCast3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.100459)
target_position = Vector3(0, 0, -0.5)
[node name="GPUParticles3D" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.18476)
material_override = SubResource("StandardMaterial3D_ynv38")
emitting = false
amount = 10
one_shot = true
explosiveness = 1.0
process_material = SubResource("ParticleProcessMaterial_58cgi")
draw_pass_1 = SubResource("BoxMesh_mfkmi")
[node name="Timer" type="Timer" parent="."]
wait_time = 10.0
one_shot = true
autostart = true
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]

View File

@ -0,0 +1,5 @@
[gd_scene load_steps=2 format=3 uid="uid://b50vg1umdgjas"]
[ext_resource type="PackedScene" uid="uid://dumj5qqh2h2tg" path="res://assets/models/weapon/DEAGLE/DEAGLE.glb" id="1_5xic7"]
[node name="DEAGLE" instance=ExtResource("1_5xic7")]

28
scenes/weapon/pistol.gd Normal file
View File

@ -0,0 +1,28 @@
extends Node3D
var bullet = load("res://scenes/weapon/bullet.tscn")
var instance
@onready var gun_anim = $Pistol/Deagle/GunAnimation
#@onready var gun_barrel = $DEAGLE/CSGSphere3D
@onready var gun_barrel = $Pistol/Deagle/RayCast3D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# TODO: Handle the shot logic
func shot():
var main_root = get_node("/root/TestMap")
if Input.is_action_pressed("shot"):
if !gun_anim.is_playing():
gun_anim.play("Shoot")
instance = bullet.instantiate()
instance.position = gun_barrel.global_position
instance.transform.basis = gun_barrel.global_transform.basis
get_tree().get_root().add_child(instance)
# TODO: Handle the reload logic
func reload():
var pistol := $DEAGLE
pistol.rotate_z(-20.0)

507
scenes/weapon/pistol.tscn Normal file

File diff suppressed because one or more lines are too long