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

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)