This commit is contained in:
veclavtlica
2026-11-01 06:41:38 +03:00
commit 7b74d0606f
17 changed files with 481 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
root = true
[*]
charset = utf-8
+2
View File
@@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
+3
View File
@@ -0,0 +1,3 @@
# Godot 4+ specific ignores
.godot/
/android/
+94
View File
@@ -0,0 +1,94 @@
[gd_scene format=3 uid="uid://crgeyg1m54cg8"]
[ext_resource type="Texture2D" uid="uid://dgkao0lkjfn8x" path="res://gun-handheld-reduced.png" id="1_glv2v"]
[ext_resource type="Texture2D" uid="uid://de7h5yetxbjii" path="res://gui-reduced.png" id="2_uu6xs"]
[ext_resource type="Script" uid="uid://biacb353kq32o" path="res://level_mesh.gd" id="3_cm0pq"]
[ext_resource type="Texture2D" uid="uid://bj63s2jg8oinu" path="res://rock22.jpg" id="4_fos0i"]
[ext_resource type="Texture2D" uid="uid://cbfvjlda1hapx" path="res://metall001-new-tileable2.png" id="5_fos0i"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_lgr22"]
sky_top_color = Color(0.15010819, 0.09080864, 3.6098065e-08, 1)
sky_horizon_color = Color(0.94753104, 0.52368605, 0.335107, 1)
sky_curve = 0.02561348
ground_curve = 0.004506263
ground_energy_multiplier = 4.86
sun_angle_max = 47.35
sun_curve = 0.040191688
use_debanding = false
[sub_resource type="Sky" id="Sky_3dxm6"]
sky_material = SubResource("ProceduralSkyMaterial_lgr22")
[sub_resource type="Environment" id="Environment_r0du0"]
background_mode = 2
sky = SubResource("Sky_3dxm6")
ambient_light_source = 3
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cm0pq"]
cull_mode = 1
shading_mode = 2
specular_mode = 2
albedo_texture = ExtResource("4_fos0i")
texture_filter = 4
fov_override = 33.9
distance_fade_mode = 1
distance_fade_max_distance = 2.0
[sub_resource type="ImmediateMesh" id="ImmediateMesh_fos0i"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_fos0i"]
shading_mode = 2
specular_mode = 2
albedo_texture = ExtResource("5_fos0i")
texture_filter = 2
fov_override = 33.9
distance_fade_mode = 2
distance_fade_max_distance = 1.0
[sub_resource type="ImmediateMesh" id="ImmediateMesh_3dxm6"]
[node name="Node3D" type="Node3D" unique_id=1749101855]
[node name="Camera3D" type="Camera3D" parent="." unique_id=1552004731]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.1841735)
[node name="Sprite3D2" type="Sprite3D" parent="." unique_id=2128191748]
transform = Transform3D(0.75, 0, 0, 0, 0.75, 0, 0, 0, 0.75, 0, 0, 0)
billboard = 1
texture_filter = 0
texture = ExtResource("2_uu6xs")
[node name="Sprite3D" type="Sprite3D" parent="." unique_id=328920978]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.47348556, -0.6719171, 0)
billboard = 1
texture_filter = 0
render_priority = 1
texture = ExtResource("1_glv2v")
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=2112481184]
environment = SubResource("Environment_r0du0")
[node name="AreaLight3D" type="AreaLight3D" parent="." unique_id=1499708949]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.8187913, 0.6215458, 0)
[node name="LevelMesh" type="Polygon2D" parent="." unique_id=1028271676 node_paths=PackedStringArray("_floor_mesh", "_wall_mesh")]
self_modulate = Color(1, 1, 1, 0)
position = Vector2(-38, -25)
color = Color(0.45490196, 0.45490196, 0.45490196, 0.6)
polygon = PackedVector2Array(198, 57, 70, 89, 166, 345, 294, 505, 550, 537, 710, 1017, 454, 1305, 678, 1593, 1030, 1529, 1130.7727, 1130.3756, 902, 505, 1574, 825, 1702, 633, 1192, 256, 838, 185, 518, 249, 390, 121)
uv = PackedVector2Array(198, 57, 70, 89, 166, 345, 294, 505, 550, 537, 710, 1017, 454, 1305, 678, 1593, 1030, 1529, 934, 793, 902, 473, 1574, 825, 1702, 633, 1094, 313, 794.0979, 279.67758, 518, 249, 390, 121)
polygons = [PackedInt32Array(0, 1, 2), PackedInt32Array(5, 6, 7), PackedInt32Array(5, 7, 8), PackedInt32Array(5, 8, 9), PackedInt32Array(4, 5, 10), PackedInt32Array(5, 9, 10), PackedInt32Array(10, 11, 13), PackedInt32Array(11, 12, 13), PackedInt32Array(10, 13, 14), PackedInt32Array(4, 10, 14), PackedInt32Array(4, 14, 15), PackedInt32Array(2, 3, 15), PackedInt32Array(3, 4, 15), PackedInt32Array(0, 2, 16), PackedInt32Array(2, 15, 16)]
script = ExtResource("3_cm0pq")
_floor_mesh = NodePath("FloorMesh")
_wall_mesh = NodePath("WallMesh")
_scale = 0.01
[node name="FloorMesh" type="MeshInstance3D" parent="LevelMesh" unique_id=961663820]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.325726, -1.0841981, -12.307181)
material_override = SubResource("StandardMaterial3D_cm0pq")
mesh = SubResource("ImmediateMesh_fos0i")
[node name="WallMesh" type="MeshInstance3D" parent="LevelMesh" unique_id=653175378]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.325726, -1.0841981, -12.307181)
material_override = SubResource("StandardMaterial3D_fos0i")
mesh = SubResource("ImmediateMesh_3dxm6")
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

+41
View File
@@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://de7h5yetxbjii"
path.s3tc="res://.godot/imported/gui-reduced.png-4f1dede9db6a089bd5e083539efdf041.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://gui-reduced.png"
dest_files=["res://.godot/imported/gui-reduced.png-4f1dede9db6a089bd5e083539efdf041.s3tc.ctex"]
[params]
compress/mode=2
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=true
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=0
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

+41
View File
@@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dgkao0lkjfn8x"
path.s3tc="res://.godot/imported/gun-handheld-reduced.png-924c714554374b4855db6ffcef0e8e35.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://gun-handheld-reduced.png"
dest_files=["res://.godot/imported/gun-handheld-reduced.png-924c714554374b4855db6ffcef0e8e35.s3tc.ctex"]
[params]
compress/mode=2
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=true
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=0
+1
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
View File
@@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cqsxf6rvpa4t3"
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
+123
View File
@@ -0,0 +1,123 @@
@tool
extends Polygon2D
var _hash: int
@export var _floor_mesh: MeshInstance3D
@export var _wall_mesh: MeshInstance3D
@export var _scale: float = 0.1
@export var _seed: int
func _ready() -> void:
if (script_changed.connect(_geometry_update) != OK):
push_error("Cannot connect _geometry_update")
# No idea how to make it getter, but whatever.
func _process(_delta: float) -> void:
var h := Array(polygon).hash() + hash(_scale) + hash(_seed)
if h != _hash:
_geometry_update()
_hash = h
func _geometry_update() -> void:
print("Rebuilding level: ", name)
if polygon.size() <= 2: return
_prepare_polygons()
_prepare_mesh()
func _prepare_polygons() -> void:
var polys := Geometry2D.triangulate_delaunay(polygon)
var pickled := Array()
for i in polys.size() / 3:
pickled.push_front(PackedInt32Array([polys[i * 3 + 0], polys[i * 3 + 1], polys[i * 3 + 2]]))
polygons = pickled
_fix_acute_polygons()
func _fix_acute_polygons() -> void:
# Outside triangles are in reversed winding, find and eliminate.
var new := Array()
for poly in polygons as Array[PackedInt32Array]:
var ab := polygon[poly[1]] - polygon[poly[0]]
var ac := polygon[poly[2]] - polygon[poly[0]]
if (ab.x * ac.y - ab.y * ac.x) * 0.5 <= 0:
new.push_front(poly)
polygons = new
func _prepare_mesh() -> void:
_prepare_floor_mesh()
_prepare_wall_mesh()
func _prepare_floor_mesh() -> void:
var m := ImmediateMesh.new()
m.surface_begin(Mesh.PRIMITIVE_LINES)
for poly in polygons as Array[PackedInt32Array]:
m.surface_add_vertex(Vector3(polygon[poly[0]].x * _scale, 0, polygon[poly[0]].y * _scale))
m.surface_add_vertex(Vector3(polygon[poly[1]].x * _scale, 0, polygon[poly[1]].y * _scale))
m.surface_add_vertex(Vector3(polygon[poly[2]].x * _scale, 0, polygon[poly[2]].y * _scale))
m.surface_end()
m.surface_begin(Mesh.PRIMITIVE_TRIANGLES)
for poly in polygons as Array[PackedInt32Array]:
m.surface_set_uv(Vector2(polygon[poly[0]].x * _scale, polygon[poly[0]].y * _scale))
m.surface_add_vertex(Vector3(polygon[poly[0]].x * _scale, 0, polygon[poly[0]].y * _scale))
m.surface_set_uv(Vector2(polygon[poly[1]].x * _scale, polygon[poly[1]].y * _scale))
m.surface_add_vertex(Vector3(polygon[poly[1]].x * _scale, 0, polygon[poly[1]].y * _scale))
m.surface_set_uv(Vector2(polygon[poly[2]].x * _scale, polygon[poly[2]].y * _scale))
m.surface_add_vertex(Vector3(polygon[poly[2]].x * _scale, 0, polygon[poly[2]].y * _scale))
m.surface_end()
_floor_mesh.mesh = m
func _prepare_wall_mesh() -> void:
var m := ImmediateMesh.new()
m.surface_begin(Mesh.PRIMITIVE_TRIANGLES)
var x := 0
var rng := RandomNumberGenerator.new()
var dy := rng.randf_range(-1.0, 1.0)
var ndy := rng.randf_range(-1.0, 1.0)
rng.seed = _seed
for ld in polygon.size():
var nd := (ld + 1) % polygon.size()
var nnd := (ld + 2) % polygon.size()
var nx := x + polygon[ld].distance_to(polygon[nd])
# Middle displacement
var depth := Vector3(-(polygon[nd].y - polygon[ld].y) * _scale, 0, (polygon[nd].x - polygon[ld].x) * _scale) * 0.2
var depth2 := Vector3(-(polygon[nnd].y - polygon[nd].y) * _scale, 0, (polygon[nnd].x - polygon[nd].x) * _scale) * 0.2
# Lower half
m.surface_set_uv(Vector2(x * _scale, 0))
m.surface_add_vertex(Vector3(polygon[ld].x * _scale, 0, polygon[ld].y * _scale))
m.surface_set_uv(Vector2(nx * _scale, 0))
m.surface_add_vertex(Vector3(polygon[nd].x * _scale, 0, polygon[nd].y * _scale))
m.surface_set_uv(Vector2(x * _scale, 3))
m.surface_add_vertex(Vector3(polygon[ld].x * _scale, 2 + dy, polygon[ld].y * _scale) + depth)
m.surface_set_uv(Vector2(nx * _scale, 0))
m.surface_add_vertex(Vector3(polygon[nd].x * _scale, 0, polygon[nd].y * _scale))
m.surface_set_uv(Vector2(nx * _scale, 3))
m.surface_add_vertex(Vector3(polygon[nd].x * _scale, 2 + ndy, polygon[nd].y * _scale) + depth2)
m.surface_set_uv(Vector2(x * _scale, 3))
m.surface_add_vertex(Vector3(polygon[ld].x * _scale, 2 + dy, polygon[ld].y * _scale) + depth)
# Upper half
m.surface_set_uv(Vector2(x * _scale, 0))
m.surface_add_vertex(Vector3(polygon[ld].x * _scale, 2 + dy, polygon[ld].y * _scale) + depth)
m.surface_set_uv(Vector2(nx * _scale, 0))
m.surface_add_vertex(Vector3(polygon[nd].x * _scale, 2 + ndy, polygon[nd].y * _scale) + depth2)
m.surface_set_uv(Vector2(x * _scale, 3))
m.surface_add_vertex(Vector3(polygon[ld].x * _scale, 5, polygon[ld].y * _scale))
m.surface_set_uv(Vector2(nx * _scale, 0))
m.surface_add_vertex(Vector3(polygon[nd].x * _scale, 2 + ndy, polygon[nd].y * _scale) + depth2)
m.surface_set_uv(Vector2(nx * _scale, 3))
m.surface_add_vertex(Vector3(polygon[nd].x * _scale, 5, polygon[nd].y * _scale))
m.surface_set_uv(Vector2(x * _scale, 3))
m.surface_add_vertex(Vector3(polygon[ld].x * _scale, 5, polygon[ld].y * _scale))
dy = ndy
ndy = rng.randf_range(-1.0, 1.0)
m.surface_end()
_wall_mesh.mesh = m
+1
View File
@@ -0,0 +1 @@
uid://biacb353kq32o
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

+41
View File
@@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cbfvjlda1hapx"
path.s3tc="res://.godot/imported/metall001-new-tileable2.png-d23c8ca4c55877f706e56917e9b6ac3c.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://metall001-new-tileable2.png"
dest_files=["res://.godot/imported/metall001-new-tileable2.png-d23c8ca4c55877f706e56917e9b6ac3c.s3tc.ctex"]
[params]
compress/mode=2
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=true
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=0
+46
View File
@@ -0,0 +1,46 @@
; 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="brawl"
run/main_scene="uid://crgeyg1m54cg8"
config/features=PackedStringArray("4.7", "GL Compatibility")
config/icon="res://icon.svg"
[debug]
gdscript/warnings/untyped_declaration=1
gdscript/warnings/unsafe_property_access=1
gdscript/warnings/unsafe_method_access=1
gdscript/warnings/unsafe_call_argument=1
gdscript/warnings/return_value_discarded=1
gdscript/warnings/integer_division=0
[display]
window/stretch/mode="canvas_items"
window/stretch/aspect="expand"
[physics]
3d/physics_engine="Jolt Physics"
[rendering]
textures/canvas_textures/default_texture_filter=3
rendering_device/driver.windows="d3d12"
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"
textures/default_filters/use_nearest_mipmap_filter=true
scaling_3d/mode=5
scaling_3d/mode.ios=5
scaling_3d/mode.macos=5
scaling_3d/scale=0.5
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

+41
View File
@@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bj63s2jg8oinu"
path.s3tc="res://.godot/imported/rock22.jpg-b50d20c0d891f90277aac14ca8cd3401.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://rock22.jpg"
dest_files=["res://.godot/imported/rock22.jpg-b50d20c0d891f90277aac14ca8cd3401.s3tc.ctex"]
[params]
compress/mode=2
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=true
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=0