Initial commit

This commit is contained in:
Rendo 2025-11-21 00:21:32 +05:00
commit 7d30fa63d1
16 changed files with 447 additions and 0 deletions

4
.editorconfig Normal file
View file

@ -0,0 +1,4 @@
root = true
[*]
charset = utf-8

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
# Godot 4+ specific ignores
.godot/
/android/

View file

@ -0,0 +1,17 @@
[gd_resource type="Environment" load_steps=3 format=3 uid="uid://d0cfgtx2yxw13"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_jbyth"]
sky_top_color = Color(0.611964, 0.34068638, 0.53929067, 1)
sky_horizon_color = Color(0.8666667, 0.58431375, 0.2901961, 1)
ground_bottom_color = Color(0.5769791, 0.25687963, 0.34936488, 1)
ground_horizon_color = Color(0.8666667, 0.58431375, 0.2901961, 1)
[sub_resource type="Sky" id="Sky_hb4cm"]
sky_material = SubResource("ProceduralSkyMaterial_jbyth")
[resource]
background_mode = 2
sky = SubResource("Sky_hb4cm")
tonemap_mode = 3
volumetric_fog_enabled = true
volumetric_fog_density = 0.0

1
icon.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>

After

Width:  |  Height:  |  Size: 995 B

43
icon.svg.import Normal file
View file

@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dnxw4x3cmu7io"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,41 @@
[gd_scene load_steps=5 format=3 uid="uid://cqrh2cc7m2i7f"]
[ext_resource type="Environment" uid="uid://d0cfgtx2yxw13" path="res://environments/prototype_environment.tres" id="1_i6jab"]
[ext_resource type="PackedScene" uid="uid://dpsr6ug3pkb40" path="res://scenes/player.tscn" id="2_ajphm"]
[ext_resource type="Material" uid="uid://bx3f5vx71ynh5" path="res://materials/OrangeMat.tres" id="4_y6i55"]
[ext_resource type="Material" uid="uid://mlha6r17v2en" path="res://materials/Bluemat.tres" id="5_bno23"]
[node name="PrototypeScene" type="Node3D"]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.8660254, -0.43301278, 0.25, 0, 0.49999997, 0.86602545, -0.50000006, 0.75, -0.43301266, 0, 0, 0)
shadow_enabled = true
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = ExtResource("1_i6jab")
[node name="Player" parent="." instance=ExtResource("2_ajphm")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.073462, 1.5000002, -0.5869317)
TOGGLE_CROUCH = false
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="."]
use_collision = true
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.577414, 2.6, 1.8908081)
use_collision = true
size = Vector3(6.901001, 1, 4.520691)
material = ExtResource("5_bno23")
[node name="CSGBox3D" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.774414, 0, 1.8908081)
material_override = ExtResource("5_bno23")
use_collision = true
size = Vector3(22.206055, 1, 21.818726)
material = ExtResource("4_y6i55")
[node name="CSGPolygon3D" type="CSGPolygon3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.49652505, 4.840562)
polygon = PackedVector2Array(0, 0, -0.061755046, 1.5814729, 2, 0)
depth = 2.45
material = ExtResource("5_bno23")

4
materials/Bluemat.tres Normal file
View file

@ -0,0 +1,4 @@
[gd_resource type="ORMMaterial3D" format=3 uid="uid://mlha6r17v2en"]
[resource]
albedo_color = Color(0.19944665, 0.5091224, 0.99999994, 1)

4
materials/OrangeMat.tres Normal file
View file

@ -0,0 +1,4 @@
[gd_resource type="ORMMaterial3D" format=3 uid="uid://bx3f5vx71ynh5"]
[resource]
albedo_color = Color(1, 0.53333336, 0, 1)

3
materials/Protomat.tres Normal file
View file

@ -0,0 +1,3 @@
[gd_resource type="ORMMaterial3D" format=3 uid="uid://c1ak0qpnpvf04"]
[resource]

116
project.godot Normal file
View file

@ -0,0 +1,116 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
[application]
config/name="Chelimbalo"
run/main_scene="uid://cqrh2cc7m2i7f"
config/features=PackedStringArray("4.5", "Forward Plus")
config/icon="res://icon.svg"
[input]
plr_forward={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
]
}
plr_back={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
]
}
plr_strafe_l={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
]
}
plr_strafe_r={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
]
}
plr_jump={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
]
}
plr_crouch={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194326,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
plr_active_first={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":90,"key_label":0,"unicode":122,"location":0,"echo":false,"script":null)
]
}
plr_active_second={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":88,"key_label":0,"unicode":120,"location":0,"echo":false,"script":null)
]
}
plr_active_third={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":67,"key_label":0,"unicode":99,"location":0,"echo":false,"script":null)
]
}
plr_ult={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null)
]
}
plr_interact={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
]
}
plr_shop={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":66,"key_label":0,"unicode":98,"location":0,"echo":false,"script":null)
]
}
plr_drop={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":71,"key_label":0,"unicode":103,"location":0,"echo":false,"script":null)
]
}
plr_fire={
"deadzone": 0.2,
"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":1,"position":Vector2(233, 20),"global_position":Vector2(242, 68),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
]
}
plr_reload={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"key_label":0,"unicode":114,"location":0,"echo":false,"script":null)
]
}
plr_scope={
"deadzone": 0.2,
"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":2,"position":Vector2(479, 24),"global_position":Vector2(488, 72),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null)
]
}
plr_walk={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
plr_firemode={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":86,"key_label":0,"unicode":118,"location":0,"echo":false,"script":null)
]
}
[layer_names]
3d_physics/layer_1="Surroundings"
3d_physics/layer_2="Players"
3d_physics/layer_3="Gadgets"
3d_physics/layer_4="Projectiles"

127
scenes/player.tscn Normal file
View file

@ -0,0 +1,127 @@
[gd_scene load_steps=9 format=3 uid="uid://dpsr6ug3pkb40"]
[ext_resource type="Script" uid="uid://3dphlay25fih" path="res://scritps/player/player.gd" id="1_g2els"]
[ext_resource type="Script" uid="uid://bjhbdh6xsjgnn" path="res://scritps/player/player_camera.gd" id="3_qhqgy"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_u8vuu"]
[sub_resource type="Animation" id="Animation_g2els"]
resource_name = "Crouch"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CollisionShape3D: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": [2.0, 1.5]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CollisionShape3D: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, 1, 0), Vector3(0, 0.75, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Camera3D: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, 2, 0), Vector3(0, 1.5, 0)]
}
[sub_resource type="Animation" id="Animation_qhqgy"]
resource_name = "Stand"
[sub_resource type="Animation" id="Animation_dqkch"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CollisionShape3D:shape:height")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [2.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CollisionShape3D:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 1, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Camera3D:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 2, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_qlg0r"]
_data = {
&"Crouch": SubResource("Animation_g2els"),
&"RESET": SubResource("Animation_dqkch"),
&"Stand": SubResource("Animation_qhqgy")
}
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_g2els"]
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("animation_player", "stand_up_area")]
collision_layer = 2
script = ExtResource("1_g2els")
animation_player = NodePath("AnimationPlayer")
stand_up_area = NodePath("StandArea")
CROUCH_TIME = 0.1
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
shape = SubResource("CapsuleShape3D_u8vuu")
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
cull_mask = 1048573
fov = 90.0
script = ExtResource("3_qhqgy")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_qlg0r")
}
[node name="StandArea" type="Area3D" parent="."]
collision_layer = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="StandArea"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
shape = SubResource("CapsuleShape3D_g2els")
debug_color = Color(0.9878064, 0, 0.31407458, 0.41960785)
debug_fill = false

64
scritps/player/player.gd Normal file
View file

@ -0,0 +1,64 @@
extends CharacterBody3D
@export var animation_player: AnimationPlayer
@export var stand_up_area: Area3D
@export var CROUCH_TIME: float = 1.0
@export var SPEED: float = 5.0
@export var JUMP_VELOCITY: float = 4.5
# Replace with settings
@export var TOGGLE_CROUCH: bool = true
@export var WALK_MODIFIER: float = 0.5
var crouched: bool = false:
set(value):
if value != crouched and stand_up_area.has_overlapping_bodies() == false:
crouched = value
update_crouch()
SPEED = (SPEED*WALK_MODIFIER) if crouched else (SPEED/WALK_MODIFIER)
potential_crouched = value
get:
return crouched
var potential_crouched: bool = crouched
func _process(delta: float) -> void:
if potential_crouched != crouched:
crouched = potential_crouched
func _physics_process(delta: float) -> void:
# Add the gravity.
if not is_on_floor():
velocity += get_gravity() * delta
# Handle jump.
if Input.is_action_just_pressed("plr_jump") and is_on_floor():
velocity.y = JUMP_VELOCITY
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var input_dir := Input.get_vector("plr_strafe_l", "plr_strafe_r", "plr_forward", "plr_back")
var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if direction:
velocity.x = direction.x * SPEED
velocity.z = direction.z * SPEED
else:
velocity.x = move_toward(velocity.x, 0, SPEED)
velocity.z = move_toward(velocity.z, 0, SPEED)
move_and_slide()
func update_crouch():
if crouched:
animation_player.play("Crouch",-1,1/CROUCH_TIME)
else:
animation_player.play("Crouch",-1,-1/CROUCH_TIME,true)
func _input(event: InputEvent) -> void:
if event.is_action_pressed("plr_crouch"):
if TOGGLE_CROUCH:
crouched = not crouched
else:
crouched = true
elif event.is_action_released("plr_crouch") and TOGGLE_CROUCH == false:
crouched = false

View file

@ -0,0 +1 @@
uid://3dphlay25fih

View file

@ -0,0 +1,16 @@
extends Camera3D
const COLLINEAR = 1.5707963267948966
@export var SENSITIVITY = 0.02
func _ready() -> void:
# Move to level controller when possible
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
func _input(event: InputEvent) -> void:
if event is InputEventMouseMotion:
get_parent().rotate_y(-event.relative.x * SENSITIVITY)
rotate_x(-event.relative.y * SENSITIVITY)
rotation.x = clamp(rotation.x,-COLLINEAR,COLLINEAR)
orthonormalize()

View file

@ -0,0 +1 @@
uid://bjhbdh6xsjgnn