22 Commits

Author SHA1 Message Date
siim 4c75776c70 debug_param_cooldown adjusts 2026-08-23 21:28:19 +03:00
siim 7688084b7e spear update 2026-08-23 21:15:25 +03:00
richard ccc92f201f mobile support tweaks 2026-08-23 20:32:52 +03:00
richard 008650a87e Merge remote-tracking branch 'origin/main' 2026-08-23 17:34:05 +03:00
richard b9e3147519 Bear, level selector (to be removed), new matador spawn, new bear level, saving config updates source files 2026-08-23 17:33:47 +03:00
richard cdba320cbc bear 2026-08-23 17:33:32 +03:00
richard ee7b1617c1 Bear, level selector (to be removed), new matador spawn, new bear level, saving config updates source files 2026-08-23 17:33:15 +03:00
richard d749485126 Map screen version 2026-08-23 13:16:04 +03:00
richard 45427b7070 Merge remote-tracking branch 'origin/main' 2026-08-23 12:37:35 +03:00
richard d514435dd8 touch controls and hud 2026-08-23 12:37:30 +03:00
siim 3eb9fa50f3 +bear boss 2026-08-23 11:18:45 +03:00
siim aee900c009 bear boss, aga broken 2026-08-21 18:23:30 +03:00
siim 4cf714f516 Update spear.glb 2026-08-17 23:49:29 +03:00
siim b78736a1f4 icon update 2026-08-10 04:43:48 +03:00
siim 212263c858 credits tuun 2026-08-10 03:53:17 +03:00
siim 8c4eeb0861 cooldowns? 2026-08-10 03:30:53 +03:00
siim 95def2d527 loading text + fullscreen default 2026-08-10 01:04:57 +03:00
siim 9a43a9ff8b icon 2026-08-09 23:58:01 +03:00
siim 7238cbf49e death anim speed .8 2026-08-09 23:19:23 +03:00
siim 44c667f097 collision scale 2026-08-09 23:15:43 +03:00
siim 3cd347d420 walk anim, death anim ja loading screen 2026-08-09 23:05:55 +03:00
richard 6414b2e7cc uids 2026-08-09 19:40:39 +03:00
87 changed files with 4049 additions and 999 deletions
+3 -2
View File
@@ -4,8 +4,9 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://dk6xuwwa0mfpe"
path.s3tc="res://.godot/imported/Arena_sand.png-416de2afe03241df088061e1a5f831af.s3tc.ctex"
path.etc2="res://.godot/imported/Arena_sand.png-416de2afe03241df088061e1a5f831af.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
generator_parameters={
@@ -15,7 +16,7 @@ generator_parameters={
[deps]
source_file="res://Assets/Arena_sand.png"
dest_files=["res://.godot/imported/Arena_sand.png-416de2afe03241df088061e1a5f831af.s3tc.ctex"]
dest_files=["res://.godot/imported/Arena_sand.png-416de2afe03241df088061e1a5f831af.s3tc.ctex", "res://.godot/imported/Arena_sand.png-416de2afe03241df088061e1a5f831af.etc2.ctex"]
[params]
+3 -2
View File
@@ -4,8 +4,9 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://b4gkpa7jypcsm"
path.s3tc="res://.godot/imported/Arena_wall.png-e67bd4bbd2f60583bfc14dd8b7687eef.s3tc.ctex"
path.etc2="res://.godot/imported/Arena_wall.png-e67bd4bbd2f60583bfc14dd8b7687eef.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
generator_parameters={
@@ -15,7 +16,7 @@ generator_parameters={
[deps]
source_file="res://Assets/Arena_wall.png"
dest_files=["res://.godot/imported/Arena_wall.png-e67bd4bbd2f60583bfc14dd8b7687eef.s3tc.ctex"]
dest_files=["res://.godot/imported/Arena_wall.png-e67bd4bbd2f60583bfc14dd8b7687eef.s3tc.ctex", "res://.godot/imported/Arena_wall.png-e67bd4bbd2f60583bfc14dd8b7687eef.etc2.ctex"]
[params]
+3 -2
View File
@@ -4,8 +4,9 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://yercpq3y2o0x"
path.s3tc="res://.godot/imported/Arena_wood.png-b4ed20d66b4d375396b0be2f2f863d80.s3tc.ctex"
path.etc2="res://.godot/imported/Arena_wood.png-b4ed20d66b4d375396b0be2f2f863d80.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
generator_parameters={
@@ -15,7 +16,7 @@ generator_parameters={
[deps]
source_file="res://Assets/Arena_wood.png"
dest_files=["res://.godot/imported/Arena_wood.png-b4ed20d66b4d375396b0be2f2f863d80.s3tc.ctex"]
dest_files=["res://.godot/imported/Arena_wood.png-b4ed20d66b4d375396b0be2f2f863d80.s3tc.ctex", "res://.godot/imported/Arena_wood.png-b4ed20d66b4d375396b0be2f2f863d80.etc2.ctex"]
[params]
BIN
View File
Binary file not shown.
+45
View File
@@ -0,0 +1,45 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://cofv5dbavesis"
path="res://.godot/imported/Bear.glb-d982be4b426919de19c028d884069d30.scn"
[deps]
source_file="res://Assets/Bear.glb"
dest_files=["res://.godot/imported/Bear.glb-d982be4b426919de19c028d884069d30.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
mesh_library/use_node_names_as_mesh_names=false
array_mesh/deduplicate_surfaces=true
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
gltf/naming_version=2
gltf/embedded_image_handling=1
gltf/texture_map_mode=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ch1wqha62vhtb"
path="res://.godot/imported/IG_square.png-c38dd1a0a4601b6ff4ffec2910ed2ce0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/IG_square.png"
dest_files=["res://.godot/imported/IG_square.png-c38dd1a0a4601b6ff4ffec2910ed2ce0.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
+1 -1
View File
@@ -28,7 +28,7 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
meshes/force_disable_compression=true
skins/use_named_skins=true
animation/import=true
animation/fps=30
+3
View File
@@ -0,0 +1,3 @@
[gd_scene format=3 uid="uid://c2dx4khl7voyd"]
[node name="BearFx" type="Node3D" unique_id=1568304275]
+42
View File
@@ -0,0 +1,42 @@
[gd_scene format=3 uid="uid://by4ifsgxlv0gj"]
[ext_resource type="PackedScene" uid="uid://bm6rmt3xprhjs" path="res://Assets/bear_level_arena.glb" id="1_beararena"]
[sub_resource type="BoxShape3D" id="BoxShape3D_floor"]
[node name="bear_level" type="Node3D" unique_id=2020009824]
[node name="Node3D" type="Node3D" parent="." unique_id=1366355859]
[node name="StaticBody3D" type="StaticBody3D" parent="Node3D" unique_id=721553462]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Node3D/StaticBody3D" unique_id=474515358]
transform = Transform3D(30, 0, 0, 0, 1, 0, 0, 0, 30, 0, -0.5, 0)
shape = SubResource("BoxShape3D_floor")
[node name="bear_level_arena" parent="." unique_id=948414670 instance=ExtResource("1_beararena")]
transform = Transform3D(2.875, 0, 0, 0, 2.875, 0, 0, 0, 2.875, 0, 0, 0)
[node name="MatadorSpawner" type="Node3D" parent="." unique_id=1869467620]
[node name="Lights" type="Node3D" parent="." unique_id=1435665429]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Lights" unique_id=1814200565]
transform = Transform3D(0.01535992, 0.56825536, -0.82270896, 0.16280846, 0.8104039, 0.56279576, 0.9865382, -0.14258848, -0.08006904, -4.08134, 9.197985, 0.97087634)
light_energy = 0.4
light_indirect_energy = 0.767
shadow_blur = 0.47
[node name="SpotLight3D2" type="SpotLight3D" parent="Lights" unique_id=2071037822]
transform = Transform3D(0.904133, 0.30962402, -0.2944087, 0.3084627, 0.0037425472, 0.9512291, 0.2956252, -0.95085174, -0.0921237, -3.629381, 10.86347, -2.0124264)
light_energy = 16.0
light_indirect_energy = 26.095
distance_fade_enabled = true
spot_range = 32.90586
spot_angle = 73.93
[node name="SUN_DirectionalLight3D2" type="DirectionalLight3D" parent="Lights" unique_id=1003843933]
transform = Transform3D(0.45811793, 0.34843865, -0.81775206, 0.5316611, 0.62986195, 0.56622505, 0.7123655, -0.69416475, 0.10329977, 0, 8.980043, 0)
light_energy = 0.106
shadow_enabled = true
shadow_blur = 10.0
Binary file not shown.
+45
View File
@@ -0,0 +1,45 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bm6rmt3xprhjs"
path="res://.godot/imported/bear_level_arena.glb-b6a9df3b338c8b0345fe2642d8b715eb.scn"
[deps]
source_file="res://Assets/bear_level_arena.glb"
dest_files=["res://.godot/imported/bear_level_arena.glb-b6a9df3b338c8b0345fe2642d8b715eb.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
mesh_library/use_node_names_as_mesh_names=false
array_mesh/deduplicate_surfaces=true
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
gltf/naming_version=2
gltf/embedded_image_handling=1
gltf/texture_map_mode=1
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -28,7 +28,7 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
meshes/force_disable_compression=true
skins/use_named_skins=true
animation/import=true
animation/fps=30
Binary file not shown.
+45
View File
@@ -0,0 +1,45 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://2e6fbder27w1"
path="res://.godot/imported/cubes_fx_test.glb-29490ce7011d666c1c4917a1a92679e4.scn"
[deps]
source_file="res://Assets/fx/cubes_fx_test.glb"
dest_files=["res://.godot/imported/cubes_fx_test.glb-29490ce7011d666c1c4917a1a92679e4.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
mesh_library/use_node_names_as_mesh_names=false
array_mesh/deduplicate_surfaces=true
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
gltf/naming_version=2
gltf/embedded_image_handling=1
gltf/texture_map_mode=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 552 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dct1d88g015el"
path="res://.godot/imported/kleeps_v2.png-55aa0dd25620611263a8b3000c5e2a49.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/kleeps_v2.png"
dest_files=["res://.godot/imported/kleeps_v2.png-55aa0dd25620611263a8b3000c5e2a49.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
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 MiB

After

Width:  |  Height:  |  Size: 3.5 MiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bh5nuyudh7x44"
path="res://.godot/imported/loading_screen.png-253743b71eb7ab3f4f9e2b29cbabf407.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/loading_screen.png"
dest_files=["res://.godot/imported/loading_screen.png-253743b71eb7ab3f4f9e2b29cbabf407.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
BIN
View File
Binary file not shown.
+29
View File
@@ -0,0 +1,29 @@
[gd_scene load_steps=5 format=3 uid="uid://bear_scene_v1"]
[ext_resource type="Script" path="res://bear.gd" id="1_beargd"]
[ext_resource type="PackedScene" uid="uid://cofv5dbavesis" path="res://Assets/Bear.glb" id="2_bearglb"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_body"]
radius = 1.0
height = 2.4
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_hit"]
radius = 1.3
height = 2.7
[node name="Bear" type="CharacterBody3D"]
script = ExtResource("1_beargd")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.2, 0)
shape = SubResource("CapsuleShape3D_body")
[node name="HitArea" type="Area3D" parent="."]
monitoring = true
monitorable = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="HitArea"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.35, 0)
shape = SubResource("CapsuleShape3D_hit")
[node name="bear_model" parent="." instance=ExtResource("2_bearglb")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
+15 -3
View File
@@ -12,13 +12,23 @@ I am a **Godot 4.6+ expert**. I follow current best practices for GDScript, scen
| Path | Purpose |
|---|---|
| `scene.tscn` | Main scene (arena + player) |
| `scene.tscn` | The reusable **shell** loaded for every level: player, camera, HUD, PS1 filter, and an empty `LevelRoot`. Its `game_shell.gd` instances the active level's module into `LevelRoot` at runtime |
| `levels/` | The level system: per-level module scenes plus the code that defines, loads and sequences them (see rows below) |
| `levels/game_shell.gd` | Shell controller — on load, frees any current level module and instances `Run.active_level().level_scene` into `LevelRoot`. Swapping the whole subtree (never hiding it) is what keeps one level's meshes/colliders/spawners from leaking into the next |
| `levels/arena_level.tscn` | The arena **level module**: floor + wall colliders, arena meshes, `MatadorSpawner` (with child `Node3D` spawn points placed by the designer), lighting, audience (`PublikNode`). Instanced into the shell's `LevelRoot` |
| `levels/bear_level.tscn` | The Bear's Den **level module**: bear-arena mesh, its own floor collider, lighting, and a `BearSpawner` (`bear_spawn.gd`) that places the bear at center. Instanced into the shell's `LevelRoot` |
| `Player.tscn` | Player scene root (`CharacterBody3D`) |
| `player.gd` | Movement, charge, turning logic |
| `camera_spring_arm.gd` | Mouse-look pivot (`Node3D` + `SpringArm3D`) |
| `camera_follow.gd` | Smooth camera follow (`Camera3D`) |
| `matador.gd` | Matador AI (wander / ragdoll state machine) |
| `matador_spawn.gd` | Spawns N matadors at random arena positions |
| `levels/matador_spawn.gd` | Arena spawner — one matador per designer-placed child `Node3D` spawn point (each enters with a jump-roll toward center); falls back to a programmatic spread if no spawn points are present. Also handles the split-on-death hydra logic |
| `levels/bear_spawn.gd` | Bear-level spawner — instantiates `enemy_scene` at the arena center; emits the same `all_defeated` / `matador_killed` signals as `matador_spawn.gd` |
| `Bear.tscn` / `bear.gd` | Dark-Souls-style bear boss (`CharacterBody3D`). Routine state machine (wind-up → active → recovery) picking telegraphed moves by range band: Double Swipe / Overhead Smash (close), Leap Slam (mid-far), plus Stalk (2-leg walk-in) / Prowl (4-leg lope) positioning. Melee steps in during the swing (`bear_lunge_speed`) + tracks the bull; the leap is frame-synced to JUMP_SMASH so the paws hit ground on the impact frame (`bear_leap_impact_frame`); slams kick up dust + shake. Combos chain, hyper-armour mid-swing + poise (`bear_stagger_cd`), phase 2 enrage under `bear_enrage_frac` HP. Never damages the bull by colliding — only swings/slams. Joins `&"matador"` so bull abilities already hit it. Tuning under the `Bear` DP section |
| `levels/run_state.gd` | Run progression autoload (`Run`) — Slay-the-Spire map + player position across fights |
| `levels/level_def.gd` | `LevelDef` resource — a level's name / map colour / `scene_path` (always the shell) / `level_scene` (the level module instanced into the shell) / optional `enemy_scene` (arena wave vs. a boss like the bear) |
| `levels/map_node.gd` | `MapNode` — one runtime node on the run map (position, level, links) |
| `levels/MapScreen.tscn` / `levels/map_screen.gd` | Between-fights map screen; win → pick a node → next level |
| `debug_params.gd` | Runtime-tunable parameter registry (autoload `DP`) |
| `Assets/` | Raw 3D assets (`.glb`, `.fbx`) |
| `Blender/` | Blender source files, animation scripts, FBX exports |
@@ -88,10 +98,12 @@ After FBX import, animations appear as `Armature|walk` and `Armature|idle` in An
bash run_tests.sh
# Individual tests:
gdlint *.gd tests/*.gd # GDScript lint (gdtoolkit, installed via uv)
gdlint *.gd levels/*.gd tests/*.gd # GDScript lint (gdtoolkit, installed via uv)
godot --headless --script tests/logic_test.gd # pure logic, ~2 s
godot --headless --script tests/performance_test.gd # frame-budget regression guard, ~4 s
godot --headless --script tests/gameplay_test.gd # full scene, bone sanity, ~4 s
godot --headless --script tests/level_switch_test.gd # no arena geometry leaks into the bear level, ~2 s
godot --headless --script tests/bear_boss_test.gd # bear boss moveset: routines, leap landing, hyper-armour, ~10 s
# Gameplay test with real rendering (inspect frame strip visually):
godot --script tests/gameplay_test.gd # opens a window, saves real screenshots
@@ -4,15 +4,16 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://bxm7c6ldrdiq5"
path.bptc="res://.godot/imported/citrus_orchard_road_puresky_4k.hdr-262868e8787abf05f7044da72beefce7.bptc.ctex"
path.astc="res://.godot/imported/citrus_orchard_road_puresky_4k.hdr-262868e8787abf05f7044da72beefce7.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://HDRI/citrus_orchard_road_puresky_4k.hdr"
dest_files=["res://.godot/imported/citrus_orchard_road_puresky_4k.hdr-262868e8787abf05f7044da72beefce7.bptc.ctex"]
dest_files=["res://.godot/imported/citrus_orchard_road_puresky_4k.hdr-262868e8787abf05f7044da72beefce7.bptc.ctex", "res://.godot/imported/citrus_orchard_road_puresky_4k.hdr-262868e8787abf05f7044da72beefce7.astc.ctex"]
[params]
+3 -2
View File
@@ -4,15 +4,16 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://3syhacswepyj"
path.bptc="res://.godot/imported/kloppenheim_06_puresky_4k.hdr-026f0eabdfce50035e2f8417ce3e0060.bptc.ctex"
path.astc="res://.godot/imported/kloppenheim_06_puresky_4k.hdr-026f0eabdfce50035e2f8417ce3e0060.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://HDRI/kloppenheim_06_puresky_4k.hdr"
dest_files=["res://.godot/imported/kloppenheim_06_puresky_4k.hdr-026f0eabdfce50035e2f8417ce3e0060.bptc.ctex"]
dest_files=["res://.godot/imported/kloppenheim_06_puresky_4k.hdr-026f0eabdfce50035e2f8417ce3e0060.bptc.ctex", "res://.godot/imported/kloppenheim_06_puresky_4k.hdr-026f0eabdfce50035e2f8417ce3e0060.astc.ctex"]
[params]
+3 -3
View File
@@ -51,7 +51,7 @@ dof_blur_near_transition = 5.0
transform = Transform3D(-0.56715536, 0, -0.8236109, 0, 1, 0, 0.8236109, 0, -0.56715536, 5.2114463, -0.08998108, 1.8927763)
script = ExtResource("2_5jr0i")
[node name="Skeleton3D" parent="Matador/Armature" parent_id_path=PackedInt32Array(166852612, 1269629432) index="0" unique_id=978366810]
[node name="Skeleton3D" parent="Matador/Armature" parent_id_path=PackedInt32Array(166852612, 1447304122) index="0" unique_id=357848305]
bones/0/position = Vector3(0.056660548, 0.6424767, -0.0167365)
bones/0/rotation = Quaternion(0.013179442, -0.2660563, 0.073319815, 0.9610747)
bones/1/rotation = Quaternion(0.06234612, 0.049236443, 0.08183311, 0.99347484)
@@ -81,10 +81,10 @@ bones/23/rotation = Quaternion(0.9993525, -0.0021175682, 0.03502641, -0.00795782
bones/24/rotation = Quaternion(0.08874816, -0.018719967, -0.04671622, 0.99478185)
bones/25/rotation = Quaternion(0.09634846, -0.0268489, -0.04050248, 0.9941608)
[node name="matador" parent="Matador/Armature/Skeleton3D" index="0" unique_id=256196413]
[node name="matador" parent="Matador/Armature/Skeleton3D" index="0" unique_id=593562242]
transform = Transform3D(0.8642424, 0, 0.50307554, 0, 1, 0, -0.50307554, 0, 0.8642424, 0, 0, 0)
[node name="Muleta" parent="Matador/Armature/Skeleton3D" index="1" unique_id=988244930]
[node name="Muleta" parent="Matador/Armature/Skeleton3D" index="1" unique_id=978680467]
cast_shadow = 0
[node name="Camera3D" type="Camera3D" parent="." unique_id=1531255459]
+2 -3
View File
@@ -2,7 +2,7 @@
[ext_resource type="Script" uid="uid://46y10alai56q" path="res://main_menu.gd" id="1_menu"]
[ext_resource type="VideoStream" uid="uid://csxxlnq74fej4" path="res://Assets/intro_bg.ogv" id="2_video"]
[ext_resource type="Shader" path="res://menu_blur.gdshader" id="3_blur"]
[ext_resource type="Shader" uid="uid://bmdtg6qlh7wri" path="res://menu_blur.gdshader" id="3_blur"]
[sub_resource type="ShaderMaterial" id="mat_blur"]
shader = ExtResource("3_blur")
@@ -74,7 +74,6 @@ grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
ratio = 1.7778
stretch_mode = 2
[node name="VideoStreamPlayer" type="VideoStreamPlayer" parent="VideoAspect" unique_id=374854265]
layout_mode = 2
@@ -281,7 +280,7 @@ bbcode_enabled = true
text = "[center][font_size=32][color=#d9a833]Bullosseum[/color][/font_size]
[b][color=#d9a833]Siim Raud[/color][/b] [url=https://instagram.com/siimpressionist]@siimpressionist[/url]
[font_size=20]Artist[/font_size]
[font_size=20]Artist / Animator[/font_size]
[b][color=#d9a833]Richard Aasa[/color][/b] [url=https://instagram.com/aasarichard]@aasarichard[/url]
[font_size=20]Programmer[/font_size]
+27
View File
@@ -35,4 +35,31 @@ script = ExtResource("2_camera_iso")
[node name="bull" parent="." unique_id=1386495166 instance=ExtResource("4_e80uo")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.655, 0.23)
[node name="Skeleton3D" parent="bull/Armature" parent_id_path=PackedInt32Array(1386495166, 1883464126) index="0" unique_id=72207798]
bones/0/position = Vector3(0, 0, 0.009963839)
bones/0/rotation = Quaternion(-0.733504, -0.0036974847, 0.0013620416, -0.67967373)
bones/0/scale = Vector3(1, 0.99999994, 0.99999994)
bones/1/position = Vector3(0.0035266252, -0.0043296535, 0.0040827994)
bones/1/rotation = Quaternion(0.020680686, 0.45675468, 0.8716418, -0.1766016)
bones/2/rotation = Quaternion(0.3289326, -0.03432299, -0.06047997, 0.94178957)
bones/4/position = Vector3(0.0045358227, -0.0021376952, -0.004238624)
bones/4/rotation = Quaternion(-0.2448651, -0.018126775, 0.96885973, -0.0319902)
bones/4/scale = Vector3(1.0000001, 1, 1.0000001)
bones/5/rotation = Quaternion(-0.7492961, -0.32333943, -0.24235487, 0.5246629)
bones/5/scale = Vector3(1, 1, 1)
bones/6/rotation = Quaternion(0.32210493, 0.15572408, 0.14126852, 0.9230611)
bones/6/scale = Vector3(0.9999998, 1, 1)
bones/17/position = Vector3(-2.3283064e-12, 0.0009373817, 0.007552617)
bones/17/rotation = Quaternion(-5.3357535e-08, 0.7071068, 0.7071067, -5.3357535e-08)
bones/19/position = Vector3(-0.0035266252, -0.0043296525, 0.0040827994)
bones/19/rotation = Quaternion(0.07793758, -0.2513099, 0.94914854, 0.1728764)
bones/20/rotation = Quaternion(-0.3791731, -0.08821739, 0.07153107, 0.91832936)
bones/22/position = Vector3(-0.0045358227, -0.0021376943, -0.004238624)
bones/22/rotation = Quaternion(0.20629132, 0.46411392, 0.84344316, 0.17506008)
bones/22/scale = Vector3(1.0000001, 1.0000001, 1.0000001)
bones/23/rotation = Quaternion(-0.7287124, 0.31838557, 0.209407, 0.5689971)
bones/23/scale = Vector3(1.0000001, 1.0000002, 1.0000002)
bones/24/rotation = Quaternion(0.71033937, -0.13944183, -0.049755, 0.6881123)
bones/24/scale = Vector3(0.9999999, 1, 1.0000001)
[editable path="bull"]
+889
View File
@@ -0,0 +1,889 @@
extends CharacterBody3D
## Dark-Souls-style boss bear with a learnable moveset. From NEUTRAL it weighs its
## options by the range band to the bull and commits to one telegraphed routine —
## wind-up (tell) → active (the hit) → recovery (the player's punish window). A routine
## always plays to the end (hyper-armour: it takes damage mid-swing but isn't knocked out
## of it), so every attack is readable and punishable. Variety comes from which routine
## NEUTRAL picks (weighted per range band); predictability from each routine being fixed
## once entered. Below bear_enrage_frac HP it enters phase 2: snappier tells/recovery and
## longer combo chains.
##
## The bear only wounds the bull with its swings and slams — walking or leaping into the
## bull does nothing. It plugs into the bull's combat interface: it joins the &"matador"
## group so every bull ability already targets it (apply_ability_hit), and mauls the bull
## via take_sword_hit.
# Positioning / neutral states, then the three attack routines, then reactions.
enum State { NEUTRAL, STALK, PROWL, SWIPE, SMASH, LEAP, STAGGER, DEAD }
# Every attack routine runs through these three beats.
enum Phase { WINDUP, ACTIVE, RECOVER }
signal killed
signal health_changed(current: int, max_hp: int)
var _state: State = State.NEUTRAL
var _phase: Phase = Phase.WINDUP
var _bull: CharacterBody3D = null
var _skeleton: Skeleton3D = null
var _anim_player: AnimationPlayer = null
var _blood_burst: CPUParticles3D = null
var _hp: int = 10
var _enraged: bool = false
var _phase_timer: float = 0.0
var _active_len: float = 0.8
var _think_timer: float = 0.0
var _state_timer: float = 0.0
var _stagger_timer: float = 0.0
var _stagger_cd: float = 0.0 # poise window after a stagger during which hits don't stun
var _hits_done: int = 0
var _leap_airborne: bool = false
# Solved per-leap so the arc lands on the clip's impact frame: the launch vertical speed
# and the custom gravity used only while airborne (so peak height and airtime are tuned
# independently of world gravity).
var _leap_up: float = 0.0
var _leap_grav: float = 0.0
# Attack routines queued to fire back-to-back as a combo, popped when the current one
# finishes its recovery. Element type is State.
var _combo_queue: Array = []
# Resolved at runtime from the rig's clip list — the Bear.glb ships Rigify-named clips
# (RUN_ON4LEGS, IDLE_standing, SMASH_HIT, …) that may import with any prefix, so we match
# by substring rather than hard-coding the full track names.
var _anim_idle: StringName = &"" # IDLE_ON4LEGS — neutral / recovery (the punish pose)
var _anim_run: StringName = &"" # RUN_ON4LEGS — prowl approach / neutral coast
var _anim_walk2: StringName = &"" # WALK_ON2LEGS — the 2-leg stalk-in
var _anim_stand: StringName = &"" # IDLE_standing — reared-up wind-up / roar
var _anim_swipe: StringName = &"" # ONE_TWO_HIT — double swipe
var _anim_smash: StringName = &"" # SMASH_HIT — overhead smash
var _anim_leap: StringName = &"" # JUMP_SMASH — leap slam
const _ACCEL_FACTOR: float = 9.0
# Hard deceleration for planted states (wind-up / recovery / neutral settle) so the bear
# never coasts across the ground with a stationary pose playing (no foot-sliding).
const _PLANT_DECEL: float = 22.0
# The Bear.glb clips are authored at 30 fps (see Bear.glb.import); leap timing is keyed by
# frame, so convert frames→seconds with this.
const _ANIM_FPS: float = 30.0
# How close the bear closes on the bull before it stops advancing (roughly the bear+bull
# body radii). Its swings still reach well past this; it just never tries to occupy the
# bull's spot, so it doesn't shove up onto it.
const _BULL_STANDOFF: float = 1.9
@onready var _mesh: Node3D = $bear_model
@onready var _hit_area: Area3D = $HitArea
var _dust: CPUParticles3D = null
# Claw-slash bursts bound to the paw bones, fired one per hit of the 1-2 punch.
var _claw_l: CPUParticles3D = null
var _claw_r: CPUParticles3D = null
const RigidSkin = preload("res://rigid_skin.gd")
func _ready() -> void:
add_to_group(&"matador") # so every existing bull ability already targets the bear
add_to_group(&"bear")
_hp = maxi(1, int(DP.f("bear_max_hp")))
health_changed.emit(_hp, _hp)
_skeleton = _find_skeleton(_mesh)
_anim_player = _find_anim_player(_mesh)
# Web (Mali/ANGLE) can't run Compatibility vertex-skinning; rebuild the bear as
# non-skinned bone-attached pieces there. Desktop keeps smooth GPU skinning.
if OS.has_feature("web"):
RigidSkin.convert_tree(self)
if _anim_player:
_anim_idle = _resolve_anim(["IDLE_ON4LEGS", "IDLE"])
_anim_run = _resolve_anim(["RUN_ON4LEGS", "RUN"])
_anim_walk2 = _resolve_anim(["WALK_ON2LEGS", "WALK", "IDLE_standing"])
_anim_stand = _resolve_anim(["IDLE_standing", "WALK_ON2LEGS"])
_anim_swipe = _resolve_anim(["ONE_TWO_HIT", "SMASH_HIT"])
_anim_smash = _resolve_anim(["SMASH_HIT", "ONE_TWO_HIT"])
_anim_leap = _resolve_anim(["JUMP_SMASH", "SMASH_HIT"])
# Loop the locomotion / idle clips; the attack clips (swipe/smash/leap) are one-shot,
# so their on-ground settle frames play once and then hold instead of looping.
for a in [_anim_idle, _anim_run, _anim_walk2, _anim_stand]:
_ensure_loop(a)
for a in [_anim_swipe, _anim_smash, _anim_leap]:
_set_no_loop(a)
_anim_player.playback_default_blend_time = 0.12
_hit_area.body_entered.connect(_on_body_entered)
_blood_burst = preload("res://blood_burst.gd").new()
add_child(_blood_burst)
_dust = _make_slam_dust()
add_child(_dust)
_setup_claws()
_enter_neutral()
# Bind a claw-slash emitter to each paw bone (hand_l / hand_r) via a BoneAttachment3D, so
# a burst fired on a swipe hit erupts from that paw wherever the animation has it.
func _setup_claws() -> void:
if _skeleton == null:
return
_claw_r = _attach_claw("hand_r")
_claw_l = _attach_claw("hand_l")
func _attach_claw(bone: String) -> CPUParticles3D:
if _skeleton.find_bone(bone) == -1:
return null
var attach := BoneAttachment3D.new()
attach.bone_name = bone
_skeleton.add_child(attach)
var claw := _make_claw_slash()
attach.add_child(claw)
return claw
func get_hp() -> int:
return _hp
func _acquire_bull() -> void:
if _bull != null:
return
var players := get_tree().get_nodes_in_group(&"player")
if not players.is_empty():
_bull = players[0] as CharacterBody3D
# The bear only ever hits via distance / area checks, never body collision, so let
# it pass through the bull. Otherwise the big capsule rides up and gets stuck on top
# of the bull when it lunges or lands a leap on it.
if _bull != null:
add_collision_exception_with(_bull)
func _physics_process(delta: float) -> void:
if not is_on_floor():
# The leap uses its own gravity mid-flight so its arc height and airtime can be
# tuned to land on the clip's impact frame; everything else falls under world gravity.
if _state == State.LEAP and _phase == Phase.ACTIVE and _leap_grav > 0.0:
velocity.y -= _leap_grav * delta
else:
velocity += get_gravity() * delta
if _state == State.DEAD:
velocity.x = 0.0
velocity.z = 0.0
move_and_slide()
return
_acquire_bull()
_update_enrage()
_stagger_cd = maxf(0.0, _stagger_cd - delta)
match _state:
State.NEUTRAL: _tick_neutral(delta)
State.STALK: _tick_stalk(delta)
State.PROWL: _tick_prowl(delta)
State.SWIPE: _tick_swipe(delta)
State.SMASH: _tick_smash(delta)
State.LEAP: _tick_leap(delta)
State.STAGGER: _tick_stagger(delta)
move_and_slide()
# ── Phase 2 ──────────────────────────────────────────────────────────────────────
func _update_enrage() -> void:
if _enraged:
return
if _hp <= int(ceil(DP.f("bear_max_hp") * DP.f("bear_enrage_frac"))):
_enraged = true
# Roar: a beat of stagger-free wind-up with a screen shake, so the phase flip reads.
_blood_burst.burst(global_position + Vector3(0.0, 1.6, 0.0), Vector3.UP)
_shake(0.9)
# Timers that shape readability (tells + recovery) shrink in phase 2; active windows and
# the clip-locked leap timings are left alone.
func _scaled(t: float) -> float:
return t * (DP.f("bear_enrage_scale") if _enraged else 1.0)
# ── NEUTRAL: think, then commit ────────────────────────────────────────────────────
func _enter_neutral() -> void:
_state = State.NEUTRAL
# A short, lightly-varied beat so the bear flows from one action into the next; phase 2
# shrinks it further. Keep the jitter small so it reads as eager, not hesitant.
var think := DP.f("bear_think_time")
_think_timer = _scaled(think * randf_range(0.7, 1.3))
func _tick_neutral(delta: float) -> void:
_decelerate(_PLANT_DECEL, delta)
if _bull != null:
_face_point(_bull.global_position, delta)
# Coast on the run clip while residual speed bleeds off, then settle to idle — never
# hold the idle pose while still sliding.
_play(_anim_run if _horizontal_speed() > 1.0 else _anim_idle)
_think_timer -= delta
if _think_timer <= 0.0:
_decide()
# Pop the next queued combo step, or pick a fresh routine weighted by the current range
# band. Weights lean into pressure (and chaining) in phase 2.
func _decide() -> void:
if not _combo_queue.is_empty():
var next: State = _combo_queue.pop_front()
if _range_allows(next):
_start_routine(next)
return
_combo_queue.clear()
if _bull == null:
_start_routine(State.PROWL)
return
var dist := _flat_dist_to_bull()
var options: Array
if dist <= DP.f("bear_close_range"):
# In strike range: punch or overhead (both step in during the swing).
options = [[State.SWIPE, 3.0], [State.SMASH, 3.0 if _enraged else 2.5]]
elif dist <= DP.f("bear_mid_range"):
# Mid: mostly walk the bull down on two legs; occasionally leap the gap.
options = [[State.STALK, 3.0], [State.LEAP, 2.0 if _enraged else 1.5]]
else:
# Far: lope in on all fours, or spring across with a leap.
options = [[State.PROWL, 3.0], [State.LEAP, 1.5]]
_start_routine(_weighted_pick(options))
# A queued combo step only fires if the bull is still roughly in its band, so a chain
# doesn't whiff into empty air after the player rolls away.
func _range_allows(routine: State) -> bool:
if _bull == null:
return routine == State.PROWL
var dist := _flat_dist_to_bull()
match routine:
State.SWIPE, State.SMASH:
return dist <= DP.f("bear_close_range") * 1.4
State.LEAP:
return dist <= DP.f("bear_mid_range") * 1.5
return true
func _start_routine(routine: State) -> void:
match routine:
State.SWIPE: _start_swipe()
State.SMASH: _start_smash()
State.LEAP: _start_leap()
State.STALK: _start_stalk()
State.PROWL: _start_prowl()
_: _enter_neutral()
# When a routine's recovery ends: fire the next combo step if one is queued, else think.
func _finish_routine() -> void:
if not _combo_queue.is_empty():
_decide()
else:
_enter_neutral()
# ── STALK: a menacing 2-leg walk-in that closes the gap into strike range ────────────
func _start_stalk() -> void:
_state = State.STALK
_state_timer = DP.f("bear_stalk_time")
func _tick_stalk(delta: float) -> void:
_state_timer -= delta
if _bull == null or _state_timer <= 0.0 or _flat_dist_to_bull() <= DP.f("bear_close_range"):
_enter_neutral()
return
var to_bull := _flat_to_bull()
_accelerate(to_bull.normalized(), DP.f("bear_stalk_speed"), delta)
_face_point(_bull.global_position, delta)
_play(_anim_walk2)
# ── PROWL: lope in on all fours to close a big gap ─────────────────────────────────
func _start_prowl() -> void:
_state = State.PROWL
_state_timer = 1.6
func _tick_prowl(delta: float) -> void:
_state_timer -= delta
if _bull == null or _state_timer <= 0.0 or _flat_dist_to_bull() <= DP.f("bear_mid_range") * 0.9:
_enter_neutral()
return
var to_bull := _flat_to_bull()
_accelerate(to_bull.normalized(), DP.f("bear_run_speed"), delta)
_face_point(_bull.global_position, delta)
_play(_anim_run)
# ── SWIPE: Double Swipe (ONE_TWO_HIT), two quick hits ──────────────────────────────
func _start_swipe() -> void:
_state = State.SWIPE
_phase = Phase.WINDUP
_phase_timer = _scaled(DP.f("bear_swipe_windup"))
_hits_done = 0
_play(_anim_stand)
# Sometimes chain the big smash after the swipe (always in phase 2) — the signature
# close string the player learns to bait and punish.
if _combo_queue.is_empty() and (_enraged or randf() < DP.f("bear_combo_chance")):
_combo_queue.append(State.SMASH)
func _tick_swipe(delta: float) -> void:
match _phase:
Phase.WINDUP:
_decelerate(_PLANT_DECEL, delta) # rear up in place — no slide
_face_point_if_bull(delta) # track hard before committing
_play(_anim_stand)
_phase_timer -= delta
if _phase_timer <= 0.0:
_begin_attack_active(_anim_swipe, 0.8)
Phase.ACTIVE:
_lunge_and_track(DP.f("bear_lunge_speed"), delta)
_phase_timer -= delta
var frac := 1.0 - _phase_timer / maxf(_active_len, 0.001)
if _hits_done == 0 and frac >= 0.25:
_hits_done = 1
_try_hit(DP.f("bear_swipe_reach"))
_claw_slash(true) # first paw (right) rakes across
elif _hits_done == 1 and frac >= 0.65:
_hits_done = 2
_try_hit(DP.f("bear_swipe_reach"))
_claw_slash(false) # back-hand with the left paw
if _phase_timer <= 0.0:
_begin_recover(DP.f("bear_swipe_recover"))
Phase.RECOVER:
_tick_recover(delta)
# ── SMASH: Overhead Smash (SMASH_HIT), slower tell, big punish window ────────────────
func _start_smash() -> void:
_state = State.SMASH
_phase = Phase.WINDUP
_phase_timer = _scaled(DP.f("bear_smash_windup"))
_hits_done = 0
_play(_anim_stand)
func _tick_smash(delta: float) -> void:
match _phase:
Phase.WINDUP:
_decelerate(_PLANT_DECEL, delta)
_face_point_if_bull(delta)
_play(_anim_stand)
_phase_timer -= delta
if _phase_timer <= 0.0:
_begin_attack_active(_anim_smash, 0.9)
Phase.ACTIVE:
# The overhead steps in less than the swipe — it's a commitment, not a rush.
_lunge_and_track(DP.f("bear_lunge_speed") * 0.5, delta)
_phase_timer -= delta
var frac := 1.0 - _phase_timer / maxf(_active_len, 0.001)
if _hits_done == 0 and frac >= 0.4:
_hits_done = 1
_slam(DP.f("bear_smash_radius"), 0.8)
if _phase_timer <= 0.0:
_begin_recover(DP.f("bear_smash_recover"))
Phase.RECOVER:
_tick_recover(delta)
# Shared wind-up → active handoff for the melee swings: start the clip (sped up for snappy
# punches) and size the active window to the sped-up clip length.
func _begin_attack_active(clip: StringName, fallback_len: float) -> void:
_phase = Phase.ACTIVE
var spd := maxf(DP.f("bear_attack_anim_speed"), 0.1)
_active_len = _anim_length(clip, fallback_len) / spd
_phase_timer = _active_len
_play_attack(clip, spd)
# ── LEAP: Leap Slam (JUMP_SMASH) — clip-synced ballistic gap-closer + AoE ────────────
# The one JUMP_SMASH clip runs start-to-finish across the whole routine: it plays the
# crouch on the ground (wind-up), springs at the takeoff frame, the arc is solved so the
# paws hit ground exactly on the impact frame, and the last frames settle on the ground.
func _start_leap() -> void:
_state = State.LEAP
_phase = Phase.WINDUP
_hits_done = 0
_leap_airborne = false
_leap_grav = 0.0
_active_len = _anim_length(_anim_leap, 1.0)
_play_attack(_anim_leap, 1.0) # play from frame 0 at real speed, grounded crouch
_phase_timer = DP.f("bear_leap_takeoff_frame") / _ANIM_FPS # ground time before the spring
# In phase 2 a leap sometimes follows straight into a swipe once it lands close.
if _enraged and _combo_queue.is_empty() and randf() < 0.5:
_combo_queue.append(State.SWIPE)
func _tick_leap(delta: float) -> void:
match _phase:
Phase.WINDUP:
_decelerate(_PLANT_DECEL, delta) # crouch in place
_face_point_if_bull(delta) # aim the pounce, tracking the bull
_phase_timer -= delta
if _phase_timer <= 0.0:
_launch_leap()
Phase.ACTIVE:
_phase_timer -= delta
if not is_on_floor():
_leap_airborne = true
elif _leap_airborne or _phase_timer <= 0.0:
velocity.x = 0.0
velocity.z = 0.0
_slam(DP.f("bear_slam_radius"), 0.7)
_phase = Phase.RECOVER
_phase_timer = _scaled(DP.f("bear_leap_recover"))
Phase.RECOVER:
_decelerate(_PLANT_DECEL, delta)
# Let the clip's on-ground settle frames finish first, then idle out the recovery.
if _anim_player != null and _anim_player.is_playing() \
and _anim_player.current_animation == _anim_leap:
return
_play(_anim_idle)
_phase_timer -= delta
if _phase_timer <= 0.0:
_finish_routine()
func _launch_leap() -> void:
_phase = Phase.ACTIVE
_leap_airborne = false
var target := _bull.global_position if _bull != null else global_position
var flat := target - global_position
flat.y = 0.0
var dist := flat.length()
var dir := flat.normalized() if dist > 0.1 else _facing()
_face_dir(dir, 1.0)
# Airtime = the clip span between the takeoff and impact frames, so the paws hit ground
# on the impact frame (25). A custom leap gravity lets the arc reach bear_leap_height in
# exactly that airtime regardless of world gravity: for a symmetric hop of airtime T to
# peak height H, v_up = 4H/T and g = 8H/T².
var air_t := maxf(
(DP.f("bear_leap_impact_frame") - DP.f("bear_leap_takeoff_frame")) / _ANIM_FPS, 0.05)
var h := maxf(DP.f("bear_leap_height"), 0.1)
_leap_up = 4.0 * h / air_t
_leap_grav = 8.0 * h / (air_t * air_t)
# Land just in front of the bull, not on top of it — the slam radius still catches it.
var land_dist := maxf(dist - _BULL_STANDOFF, 0.0)
var h_speed := clampf(land_dist / air_t, 0.0, DP.f("bear_leap_speed"))
velocity = dir * h_speed + Vector3.UP * _leap_up
_phase_timer = air_t + 1.0 # safety fallback if a landing is missed
func _begin_recover(secs: float) -> void:
_phase = Phase.RECOVER
_phase_timer = _scaled(secs)
func _tick_recover(delta: float) -> void:
_decelerate(_PLANT_DECEL, delta)
_play(_anim_idle)
_phase_timer -= delta
if _phase_timer <= 0.0:
_finish_routine()
func _tick_stagger(delta: float) -> void:
_decelerate(12.0, delta)
_stagger_timer -= delta
_play(_anim_idle)
if _stagger_timer <= 0.0:
_stagger_cd = DP.f("bear_stagger_cd") # poise window so it can act before the next stun
_enter_neutral()
# Step toward the bull during a swing (so a strike lands even when the bull is a touch out
# of reach) while tracking its facing — but plant once close so the bear doesn't shove
# through it. Motion here reads as the strike's lunge, under the attack clip.
func _lunge_and_track(speed: float, delta: float) -> void:
if _bull == null:
_decelerate(_PLANT_DECEL, delta)
return
_face_point(_bull.global_position, delta, DP.f("bear_track_active"))
var to_bull := _flat_to_bull()
var dist := to_bull.length()
if speed > 0.0 and dist > _BULL_STANDOFF:
_accelerate(to_bull / dist, speed, delta)
else:
_decelerate(_PLANT_DECEL, delta)
# ── Hitting the bull ───────────────────────────────────────────────────────────────
# Directional strike: the bull is mauled inside `reach` of the bear that's facing it
# (a fast bull tunnels a thin collider between frames, so distance + facing is the
# reliable hit). Returns whether it connected.
func _try_hit(reach: float) -> bool:
if _bull == null:
return false
var to_bull := _flat_to_bull()
var dist := to_bull.length()
if dist > reach or dist < 0.01:
return false
if _facing().dot(to_bull / dist) < cos(deg_to_rad(DP.f("bear_hit_arc"))):
return false
_bull.call(&"take_sword_hit", "mauled")
_shake(0.55)
return true
# Radial slam (smash / leap landing): hits any way the bull is, within `radius`, with a
# ground-pound shake and a burst of dust kicked up at the paws. No facing arc — you're
# caught if you're near where it comes down.
func _slam(radius: float, shake: float) -> void:
_slam_dust()
if _bull == null:
_shake(shake)
return
if _flat_dist_to_bull() <= radius:
_bull.call(&"take_sword_hit", "mauled")
_shake(shake)
# Kick up a one-shot ring of dust at the bear's feet where the slam lands.
func _slam_dust() -> void:
if _dust == null:
return
_dust.global_position = global_position + Vector3(0.0, 0.15, 0.0)
_dust.restart()
_dust.emitting = true
# Tan ground-impact dust: a fast, wide, low burst that arcs up and settles — built in code
# so the Bear scene needs no extra particle node.
func _make_slam_dust() -> CPUParticles3D:
var p := CPUParticles3D.new()
var mat := StandardMaterial3D.new()
mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED
mat.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA
mat.vertex_color_use_as_albedo = true
mat.cull_mode = BaseMaterial3D.CULL_DISABLED
var sphere := SphereMesh.new()
sphere.radius = 0.16
sphere.height = 0.32
sphere.radial_segments = 4
sphere.rings = 2
sphere.material = mat
var ramp := Gradient.new()
ramp.set_color(0, Color(0.72, 0.60, 0.40, 0.9))
ramp.set_color(1, Color(0.55, 0.45, 0.30, 0.0))
var scale_curve := Curve.new()
scale_curve.add_point(Vector2(0.0, 0.4))
scale_curve.add_point(Vector2(0.35, 1.0))
scale_curve.add_point(Vector2(1.0, 0.0))
p.mesh = sphere
p.color_ramp = ramp
p.scale_amount_curve = scale_curve
p.emitting = false
p.one_shot = true
p.explosiveness = 1.0
p.amount = 36
p.lifetime = 0.9
p.randomness = 0.5
p.local_coords = false
# A flat-ish disc kicked outward and up from the ground.
p.emission_shape = CPUParticles3D.EMISSION_SHAPE_SPHERE
p.emission_sphere_radius = 0.5
p.direction = Vector3(0.0, 1.0, 0.0)
p.spread = 75.0
p.gravity = Vector3(0.0, -6.0, 0.0)
p.initial_velocity_min = 2.5
p.initial_velocity_max = 6.5
p.scale_amount_min = 0.6
p.scale_amount_max = 1.4
return p
# Fire the claw-slash burst on one paw for a swipe hit (right paw first, then left).
func _claw_slash(right: bool) -> void:
var claw := _claw_r if right else _claw_l
if claw == null:
return
claw.restart()
claw.emitting = true
# A short fan of pale streaks raked from a paw — thin boxes aligned to their velocity so
# they read as claw marks slashing outward. Built in code and parented to a hand bone.
func _make_claw_slash() -> CPUParticles3D:
var p := CPUParticles3D.new()
var mat := StandardMaterial3D.new()
mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED
mat.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA
mat.blend_mode = BaseMaterial3D.BLEND_MODE_ADD
mat.vertex_color_use_as_albedo = true
mat.cull_mode = BaseMaterial3D.CULL_DISABLED
# A thin, long box becomes a streak once aligned to its velocity.
var streak := BoxMesh.new()
streak.size = Vector3(0.03, 0.55, 0.03)
streak.material = mat
var ramp := Gradient.new()
ramp.set_color(0, Color(0.85, 0.95, 1.0, 0.95))
ramp.set_color(1, Color(0.5, 0.75, 1.0, 0.0))
var scale_curve := Curve.new()
scale_curve.add_point(Vector2(0.0, 1.0))
scale_curve.add_point(Vector2(0.7, 1.0))
scale_curve.add_point(Vector2(1.0, 0.0))
p.mesh = streak
p.color_ramp = ramp
p.scale_amount_curve = scale_curve
p.emitting = false
p.one_shot = true
p.explosiveness = 1.0 # all at once = a single rake, not a stream
p.amount = 5 # a handful of parallel claw marks
p.lifetime = 0.22
p.randomness = 0.2
p.local_coords = false # streaks stay in the air where they were raked, then fade
p.set_particle_flag(CPUParticles3D.PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY, true)
# Rake across the paw's swing plane: a tight fan of fast streaks.
p.emission_shape = CPUParticles3D.EMISSION_SHAPE_SPHERE
p.emission_sphere_radius = 0.12
p.direction = Vector3(0.0, 0.0, 1.0)
p.spread = 22.0
p.gravity = Vector3.ZERO
p.initial_velocity_min = 6.0
p.initial_velocity_max = 9.0
return p
func _shake(amount: float) -> void:
if _bull == null:
return
var cam := _bull.get_node_or_null("Camera3D")
if cam:
cam.call(&"trigger_hit", clampf(amount, 0.2, 1.0))
# ── Taking damage ──────────────────────────────────────────────────────────────────
# Called by every bull ability (kick / slam / roll) that iterates the matador group.
func apply_ability_hit(hit_dir: Vector3, strength: float, _up_boost: float = 0.0) -> void:
_acquire_bull()
_take_hit(hit_dir, strength)
# Ramming: only a real charge from the bull wounds the bear; a gentle nudge is shrugged
# off. The bear never damages the bull by colliding — only its swings/slams do.
func _on_body_entered(body: Node3D) -> void:
if _state == State.DEAD or not body.is_in_group(&"player"):
return
var player := body as CharacterBody3D
if player.velocity.length() < DP.f("bear_hit_threshold"):
return
var flat := Vector3(player.velocity.x, 0.0, player.velocity.z)
var dir := flat.normalized() if flat.length() > 0.5 else \
(global_position - player.global_position).normalized()
_take_hit(dir, player.velocity.length())
func _take_hit(hit_dir: Vector3, strength: float) -> void:
if _state == State.DEAD:
return
_hp -= 1
health_changed.emit(_hp, int(DP.f("bear_max_hp")))
hit_dir.y = 0.0
hit_dir = hit_dir.normalized()
_blood_burst.burst(global_position + Vector3(0.0, 1.4, 0.0), hit_dir)
_shake(clampf(strength / 15.0, 0.4, 1.0))
if _hp <= 0:
_die(hit_dir)
return
# Hyper-armour: a committed swing takes the wound but isn't knocked out of it — only
# the vulnerable states (neutral / positioning / a routine's recovery) stagger. This
# is what makes the recovery the real punish window.
if not _can_stagger():
return
velocity.x = hit_dir.x * 4.0
velocity.z = hit_dir.z * 4.0
_combo_queue.clear()
_state = State.STAGGER
_stagger_timer = DP.f("bear_stagger_time")
func _can_stagger() -> bool:
if _stagger_cd > 0.0:
return false # poise: recently staggered, so it rides out hits instead of stun-locking
match _state:
State.NEUTRAL, State.STALK, State.PROWL, State.STAGGER:
return true
State.SWIPE, State.SMASH, State.LEAP:
return _phase == Phase.RECOVER # airborne / mid-swing can't be staggered
return false
func _die(hit_dir: Vector3) -> void:
_state = State.DEAD
killed.emit()
collision_layer = 0
if _hit_area:
_hit_area.monitoring = false
velocity = Vector3.ZERO
_blood_burst.burst(global_position + Vector3(0.0, 1.4, 0.0), hit_dir)
_play(_anim_idle)
# No death clip on the rig — topple the beast onto its side (about the hit direction,
# so it falls the way it was struck) and sink it away, then free.
var fall_axis := Vector3(-hit_dir.z, 0.0, hit_dir.x)
if fall_axis.length() < 0.01:
fall_axis = Vector3.RIGHT
var tween := create_tween()
tween.tween_property(_mesh, "rotation",
_mesh.rotation + fall_axis.normalized() * deg_to_rad(88.0), 0.7)\
.set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)
tween.tween_interval(2.5)
tween.tween_property(_mesh, "position:y", _mesh.position.y - 3.0, 1.0)
tween.tween_callback(queue_free)
# ── Interface shared with the matador (guarded elsewhere via has_method) ─────────────
func is_active() -> bool:
return _state != State.DEAD
func ai_state_name() -> String:
var n := State.keys()[_state] as String
if _state in [State.SWIPE, State.SMASH, State.LEAP]:
n += ":" + (Phase.keys()[_phase] as String)
if _enraged:
n += "*"
return n
# ── Movement / geometry helpers ─────────────────────────────────────────────────────
func _flat_to_bull() -> Vector3:
var to := _bull.global_position - global_position
to.y = 0.0
return to
func _flat_dist_to_bull() -> float:
return _flat_to_bull().length()
func _horizontal_speed() -> float:
return Vector2(velocity.x, velocity.z).length()
func _facing() -> Vector3:
return Vector3(sin(_mesh.rotation.y), 0.0, cos(_mesh.rotation.y))
func _accelerate(dir: Vector3, spd: float, delta: float) -> void:
velocity.x = move_toward(velocity.x, dir.x * spd, spd * _ACCEL_FACTOR * delta)
velocity.z = move_toward(velocity.z, dir.z * spd, spd * _ACCEL_FACTOR * delta)
func _decelerate(rate: float, delta: float) -> void:
velocity.x = move_toward(velocity.x, 0.0, rate * delta)
velocity.z = move_toward(velocity.z, 0.0, rate * delta)
func _face_point_if_bull(delta: float, rate: float = -1.0) -> void:
if _bull != null:
_face_point(_bull.global_position, delta, rate)
func _face_point(point: Vector3, delta: float, rate: float = -1.0) -> void:
_face_dir(point - global_position, delta, rate)
func _face_dir(dir: Vector3, delta: float, rate: float = -1.0) -> void:
if rate < 0.0:
rate = DP.f("bear_turn_rate")
dir.y = 0.0
if dir.length_squared() > 0.01:
_mesh.rotation.y = lerp_angle(_mesh.rotation.y, atan2(dir.x, dir.z), delta * rate)
func _weighted_pick(options: Array) -> State:
var total := 0.0
for o: Array in options:
total += o[1]
var r := randf() * total
for o: Array in options:
r -= o[1]
if r <= 0.0:
return o[0]
return options[0][0]
# ── Animation helpers ───────────────────────────────────────────────────────────────
func _resolve_anim(candidates: Array) -> StringName:
if _anim_player == null:
return &""
var list := _anim_player.get_animation_list()
for want: String in candidates:
for have: String in list:
if have.to_upper().contains(want.to_upper()):
return StringName(have)
return &""
func _ensure_loop(anim_name: StringName) -> void:
if anim_name != &"" and _anim_player.has_animation(anim_name):
_anim_player.get_animation(anim_name).loop_mode = Animation.LOOP_LINEAR
func _set_no_loop(anim_name: StringName) -> void:
if anim_name != &"" and _anim_player.has_animation(anim_name):
_anim_player.get_animation(anim_name).loop_mode = Animation.LOOP_NONE
func _anim_length(anim_name: StringName, fallback: float) -> float:
if _anim_player and anim_name != &"" and _anim_player.has_animation(anim_name):
return _anim_player.get_animation(anim_name).length
return fallback
func _play(anim_name: StringName) -> void:
if _anim_player == null or anim_name == &"":
return
if _anim_player.current_animation == anim_name:
return
_anim_player.play(anim_name)
# Restart a one-shot attack clip from its first frame at `speed` (even if already current).
func _play_attack(anim_name: StringName, speed: float) -> void:
if _anim_player == null or anim_name == &"":
return
_anim_player.play(anim_name, -1.0, speed)
_anim_player.seek(0.0, true)
func _find_skeleton(node: Node) -> Skeleton3D:
if node is Skeleton3D:
return node as Skeleton3D
for child: Node in node.get_children():
var r := _find_skeleton(child)
if r:
return r
return null
func _find_anim_player(node: Node) -> AnimationPlayer:
if node is AnimationPlayer:
return node as AnimationPlayer
for child: Node in node.get_children():
var r := _find_anim_player(child)
if r:
return r
return null
+1
View File
@@ -0,0 +1 @@
uid://cn7fhjkro7637
+9
View File
@@ -42,6 +42,15 @@ func _unhandled_input(event: InputEvent) -> void:
_user_fov = clamp(_user_fov * 1.1, fov_min, fov_max)
# Pinch-to-zoom hook for the touch UI. `ratio` is the two-finger spread this frame over
# last frame: >1 (fingers parting) narrows the FOV to zoom in, <1 widens it to pull back,
# mirroring the scroll-wheel zoom_in/zoom_out feel.
func adjust_zoom(ratio: float) -> void:
if ratio <= 0.0:
return
_user_fov = clampf(_user_fov / ratio, fov_min, fov_max)
func _process(delta: float) -> void:
fov = lerpf(fov, _user_fov, delta * 8.0)
+29 -2
View File
@@ -18,6 +18,8 @@ const _COMMANDS := {
"diff": "list params changed from default",
"toggle": "flip a bool param",
"list": "print params (optional section)",
"level": "select level and reload (level <id> — arena / arena_boss / bear)",
"restart": "reload the current level scene",
"clear": "clear the log",
"help": "show this help",
}
@@ -472,6 +474,12 @@ func _run_command(parts: PackedStringArray) -> bool:
_cmd_diff()
"list":
_cmd_list(parts)
"level":
_cmd_level(parts)
"restart":
_log_ok("Restarting…")
get_tree().paused = false
get_tree().reload_current_scene()
"clear":
_log.clear()
"help":
@@ -581,9 +589,9 @@ func _set_param(key: String, meta: Dictionary, raw: String) -> void:
var lo := meta["min"] as float
var hi := meta["max"] as float
if not raw.is_valid_float() or not is_finite(raw.to_float()):
_log_warn("%s wants a number %s%s" % [key, _fmt_num(lo), _fmt_num(hi)])
_log_warn("%s wants a number" % key)
return
var v := snappedf(clampf(raw.to_float(), lo, hi), meta["step"] as float)
var v := raw.to_float()
DP.set_value(key, v)
_log_ok("[b]%s[/b] ← [color=#ffe080]%s[/color]" % [key, _fmt_num(v)])
elif meta["type"] == TYPE_BOOL:
@@ -600,6 +608,25 @@ func _set_param(key: String, meta: Dictionary, raw: String) -> void:
_log_warn("Cannot set param of type %d" % meta["type"])
func _cmd_level(parts: PackedStringArray) -> void:
if parts.size() == 1:
var cur := Run.active_level()
var cur_name := (cur.id as String) if cur != null else "none"
_log_ok("Current level: [b]%s[/b]" % cur_name)
var ids: Array[StringName] = Run.level_ids()
_log_raw("Available: " + " ".join(ids.map(func(id: StringName) -> String: return str(id))))
return
var id := StringName(parts[1].to_lower())
var level := Run.get_level(id)
if level == null:
_log_warn("Unknown level '%s'. Try: %s" % [parts[1], " ".join(Run.level_ids().map(func(i: StringName) -> String: return str(i)))])
return
Run.debug_level_override = level
_log_ok("Level set to [b]%s[/b] — reloading…" % str(id))
get_tree().paused = false
get_tree().change_scene_to_file(level.scene_path)
func _cmd_list(parts: PackedStringArray) -> void:
var filter := parts[1].to_lower() if parts.size() > 1 else ""
var all := DP.get_all()
+83 -6
View File
@@ -25,19 +25,96 @@ func _ready() -> void:
load_saved()
# ── Web fullscreen + landscape lock ─────────────────────────────────────────────
# Browsers only allow requestFullscreen / screen.orientation.lock from inside a user
# gesture, so we piggyback on the first tap/click of the web build to go fullscreen and
# lock to landscape. One-shot; input still flows to the menu/game normally (never consumed).
var _fs_triggered: bool = false
func _input(event: InputEvent) -> void:
if _fs_triggered or not OS.has_feature("web"):
return
var gesture := (event is InputEventScreenTouch and (event as InputEventScreenTouch).pressed) \
or (event is InputEventMouseButton and (event as InputEventMouseButton).pressed)
if gesture:
_fs_triggered = true
request_fullscreen_landscape()
## Enter browser fullscreen and lock to landscape. Must be called from a user-gesture
## context (first tap, or a button press). No-op off web. Android Chrome/Brave honour the
## orientation lock; iOS Safari ignores it (unsupported), so the .catch() swallows the reject.
func request_fullscreen_landscape() -> void:
if not OS.has_feature("web"):
return
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
JavaScriptBridge.eval(
"(function(){function l(){try{if(screen.orientation&&screen.orientation.lock)"
+ "screen.orientation.lock('landscape').catch(function(){});}catch(e){}}"
+ "l();document.addEventListener('fullscreenchange',l,{once:true});})()", true)
## Whether to drive the game with the on-screen touch UI (joystick + buttons)
## instead of keyboard hints. DisplayServer.is_touchscreen_available() can't be
## used here: `emulate_touch_from_mouse` (on for desktop testing) makes it report
## true on every desktop. Gate on the actual runtime platform instead — real
## mobile/native and mobile web browsers — plus the DP force flag for testing.
## instead of keyboard hints. Platform detection is cached (it can't change mid-run)
## so the per-frame/per-input callers don't repay the cost — but the DP force flag is
## re-read every call so the console can toggle the layout live on a desktop build.
var _touch_ui_cached: int = -1 # -1 = not yet detected, 0 = false, 1 = true
func use_touch_ui() -> bool:
if DP.b("force_touch_controls"):
return true
return (
if _touch_ui_cached == -1:
_touch_ui_cached = 1 if _detect_touch_ui() else 0
return _touch_ui_cached == 1
## True only on touch-primary devices (phones, tablets). Detection is deliberately
## conservative so a desktop never gets the on-screen thumb UI.
##
## DisplayServer.is_touchscreen_available() is unusable here on two fronts: on native
## desktop `emulate_touch_from_mouse` (on for testing) forces it true, and on the web build
## it maps to `'ontouchstart' in window`, which desktop Chromium reports true even with no
## touchscreen. So on web we ask the browser two questions instead: does it report touch
## points, AND is the *primary* pointer coarse? A desktop-with-mouse (even a touch laptop)
## answers no to the second and keeps the desktop HUD; a phone/tablet answers yes to both.
## maxTouchPoints also catches iPadOS, which masquerades as desktop Safari.
func _detect_touch_ui() -> bool:
if (
OS.has_feature("mobile")
or OS.has_feature("web_android")
or OS.has_feature("web_ios")
)
):
return true
if not OS.has_feature("web"):
return false
var js := "(navigator.maxTouchPoints > 0) && window.matchMedia('(pointer: coarse)').matches"
var touch_primary: Variant = JavaScriptBridge.eval(js, true)
if touch_primary is bool:
return touch_primary
if touch_primary is int or touch_primary is float:
return int(touch_primary) != 0
return false
## Whether on-screen debug overlays (touch state + render diagnostics) should show. True on
## the DP "touch_debug" flag, or — so it can be switched on from a phone where no console is
## reachable — when the page URL carries a `debug` query param (append `?debug=1`).
var _url_debug: int = -1
func debug_overlay() -> bool:
if DP.b("touch_debug"):
return true
if _url_debug == -1:
_url_debug = 0
if OS.has_feature("web"):
var has: Variant = JavaScriptBridge.eval(
"String(window.location.search).indexOf('debug') >= 0", true)
if (has is bool and has) or ((has is int or has is float) and int(has) != 0):
_url_debug = 1
return _url_debug == 1
## Returns the first keyboard event bound to an action, or null.
+116 -20
View File
@@ -17,7 +17,6 @@ var _values: Dictionary = {}
func _ready() -> void:
_register_all()
load_saved()
func _register_all() -> void:
@@ -46,12 +45,12 @@ func _register_all() -> void:
_reg_f("Dust", "dust_explosiveness", 0.35, 0.0, 1.0)
_reg_f("Dust", "dust_spread", 45.0, 5.0, 90.0)
_reg_f("Dust", "dust_gravity_y", -1.5,-15.0, 0.0)
_reg_f("Dust", "walk_scale_min", 0.35, 0.05, 3.0)
_reg_f("Dust", "walk_scale_max", 0.65, 0.05, 3.0)
_reg_f("Dust", "walk_scale_min", 0.20, 0.05, 3.0)
_reg_f("Dust", "walk_scale_max", 0.40, 0.05, 3.0)
_reg_f("Dust", "walk_vel_min", 0.8, 0.1, 12.0)
_reg_f("Dust", "walk_vel_max", 1.8, 0.1, 12.0)
_reg_f("Dust", "charge_scale_min", 1.0, 0.05, 6.0)
_reg_f("Dust", "charge_scale_max", 2.2, 0.05, 6.0)
_reg_f("Dust", "charge_scale_min", 0.35, 0.05, 6.0)
_reg_f("Dust", "charge_scale_max", 0.70, 0.05, 6.0)
_reg_f("Dust", "charge_vel_min", 2.8, 0.1, 20.0)
_reg_f("Dust", "charge_vel_max", 5.5, 0.1, 20.0)
# ── Tail ──────────────────────────────────────────────────────────────────
@@ -99,16 +98,11 @@ func _register_all() -> void:
_reg_f("Camera", "cam_drag_speed", 3.5, 0.5, 20.0)
_reg_f("Camera", "cam_follow_lerp", 10.0, 1.0, 40.0)
# ── Matador ───────────────────────────────────────────────────────────────
_reg_f("Matador", "mat_spawn_count", 1.0, 1.0, 30.0, 1.0)
# Hydra split: a slain matador is replaced on the spot by mat_split_factor fresh
# matadors, so the horde doubles each generation (1 → 2 → 4 → 8 …) at the default
# 2. Capped at mat_split_generations deep so the arena stays winnable (factor <2 or
# generations 0 = no splitting, the classic one-and-done arena).
_reg_f("Matador", "mat_split_factor", 2.0, 1.0, 6.0, 1.0)
_reg_f("Matador", "mat_split_generations", 3.0, 0.0, 6.0, 1.0)
# The bull wins outright once it has slain this many matadors, even if the hydra
# still has bodies on the sand. 0 = disabled (win only when the horde dies out)
_reg_f("Matador", "mat_win_kills", 21.0, 0.0, 200.0, 1.0)
# Wave system: matadors enter the arena in escalating waves (1 → 2 → … → N where N
# is the number of placed spawn points). mat_spawn_stagger is the delay between each
# matador leaping in within a wave; mat_wave_pause is the breather after a wave clears.
_reg_f("Matador", "mat_spawn_stagger", 0.4, 0.0, 3.0, 0.05)
_reg_f("Matador", "mat_wave_pause", 2.0, 0.0, 8.0, 0.25)
_reg_f("Matador", "mat_walk_speed", 5.5, 0.5, 10.0)
_reg_f("Matador", "mat_wander_radius", 22.0, 5.0, 50.0)
# Radius of the inner fighting floor: bull + matadors spawn on this ring (so
@@ -190,6 +184,76 @@ func _register_all() -> void:
_reg_f("Matador", "mat_taunt_hold", 8.0, 1.0, 20.0, 0.5)
# Small so it smooths dithering without locking the matador into idling.
_reg_f("Matador", "mat_w_commit", 0.15, 0.0, 2.0, 0.05)
# ── Bear (boss) ─────────────────────────────────────────────────────────────
# A Dark-Souls-style boss with a learnable moveset. It soaks bear_max_hp clean hits
# (ram or ability), staggering on each, and only topples when worn down. From NEUTRAL
# it weighs its options by the range band to the bull and commits to one telegraphed
# routine (wind-up → active → recovery); each routine plays to the end (the recovery
# is the player's punish window). Below bear_enrage_frac HP it enters phase 2: faster
# tells and recovery (× bear_enrage_scale) and longer combo chains.
_reg_f("Bear", "bear_max_hp", 50.0, 1.0, 100.0, 1.0)
# HP fraction at which phase 2 ("Fury") triggers, and how much it multiplies every
# wind-up / recovery timer (lower = snappier, more dangerous).
_reg_f("Bear", "bear_enrage_frac", 0.4, 0.0, 1.0, 0.05)
_reg_f("Bear", "bear_enrage_scale", 0.7, 0.3, 1.0, 0.05)
# Range bands (m) that pick the moveset: ≤close it strikes (swipe / smash), ≤mid it
# walks in to close the gap (stalk) or leaps, beyond it lopes in (prowl) or leaps.
# close is deliberately generous — the bear commits to melee "from a bit further" and
# steps in during the swing (see bear_lunge_speed) rather than needing to be on top.
_reg_f("Bear", "bear_close_range", 5.0, 1.0, 12.0, 0.1)
_reg_f("Bear", "bear_mid_range", 9.0, 3.0, 20.0, 0.5)
# Beat spent in NEUTRAL sizing up the bull between routines — kept short so the bear
# flows straight from one action into the next instead of pausing (raise for a more
# hesitant, readable boss; near-0 for relentless pressure). Shrinks again in phase 2.
_reg_f("Bear", "bear_think_time", 0.06, 0.0, 1.0, 0.01)
# Locomotion: the all-fours prowl (close a big gap), the menacing 2-leg walk-in
# (stalk), the facing rate while positioning/winding up, and the softer tracking rate
# a swing keeps on the bull mid-attack so it's harder to just walk out of.
_reg_f("Bear", "bear_run_speed", 11.0, 1.0, 20.0, 0.1)
_reg_f("Bear", "bear_stalk_speed", 5.5, 0.5, 12.0, 0.1)
_reg_f("Bear", "bear_turn_rate", 7.0, 1.0, 20.0, 0.5)
_reg_f("Bear", "bear_track_active", 3.5, 0.0, 12.0, 0.1)
# Forward step-in during a swing so a strike lands even when the bull is a touch out of
# reach (also carries the tracking); 0 = a purely stationary swing.
_reg_f("Bear", "bear_lunge_speed", 7.0, 0.0, 16.0, 0.5)
# Playback multiplier for the swipe/smash clips — >1 makes the punches snappier.
_reg_f("Bear", "bear_attack_anim_speed", 1.35, 0.5, 3.0, 0.05)
# Half-arc (deg) the bear must be facing the bull within for a directional swing to
# connect; slams use their own radius instead of an arc.
_reg_f("Bear", "bear_hit_arc", 70.0, 5.0, 180.0, 5.0)
# Double Swipe (ONE_TWO_HIT) — bread-and-butter close combo, two quick hits.
_reg_f("Bear", "bear_swipe_windup", 0.3, 0.05, 2.0, 0.05)
_reg_f("Bear", "bear_swipe_recover", 0.35, 0.05, 3.0, 0.05)
_reg_f("Bear", "bear_swipe_reach", 4.2, 1.0, 8.0, 0.1)
# Overhead Smash (SMASH_HIT) — slower tell, biggest punish window, AoE on impact.
_reg_f("Bear", "bear_smash_windup", 0.6, 0.1, 3.0, 0.05)
_reg_f("Bear", "bear_smash_recover", 0.75, 0.1, 4.0, 0.05)
_reg_f("Bear", "bear_smash_radius", 4.2, 1.0, 8.0, 0.1)
# Leap Slam (JUMP_SMASH, 47 frames @30fps) — timed to the clip by FRAME: it plays the
# crouch grounded, springs at the takeoff frame, and the arc is solved so the paws hit
# ground exactly on the impact frame (25), leaving the tail frames to settle on the
# ground — no finishing the anim in mid-air. The arc uses its own gravity so peak height
# and airtime are independent: bear_leap_height is the peak reached in that fixed airtime.
_reg_f("Bear", "bear_leap_takeoff_frame", 6.0, 0.0, 46.0, 1.0)
_reg_f("Bear", "bear_leap_impact_frame", 25.0, 1.0, 47.0, 1.0)
_reg_f("Bear", "bear_leap_height", 2.6, 0.5, 8.0, 0.1)
_reg_f("Bear", "bear_leap_recover", 0.35, 0.0, 4.0, 0.05)
_reg_f("Bear", "bear_leap_speed", 14.0, 4.0, 30.0, 0.5)
_reg_f("Bear", "bear_slam_radius", 4.0, 1.0, 8.0, 0.1)
# Stalk (WALK_ON2LEGS) — how long it will keep walking the bull down before re-deciding.
_reg_f("Bear", "bear_stalk_time", 2.5, 0.0, 6.0, 0.1)
# Odds a close combo chains a follow-up smash after the swipe (phase 2 always chains).
_reg_f("Bear", "bear_combo_chance", 0.7, 0.0, 1.0, 0.05)
# Minimum bull speed (ram) that counts as a hit on the bear — a gentle nudge is
# shrugged off, only a real charge or an ability wounds it. (The bear itself never
# damages the bull by colliding — only its swings and slams hurt.)
_reg_f("Bear", "bear_hit_threshold", 6.0, 1.0, 30.0, 0.5)
# How long (s) the bear is rocked back and can't act after taking a hit.
_reg_f("Bear", "bear_stagger_time", 0.5, 0.0, 2.0, 0.05)
# Poise: after a stagger the bear shrugs off staggers for this long (hits still wound
# it), so it can't be perma-stunlocked — it gets a window to commit an attack that then
# rides its hyper-armour. 0 = no poise (stun-locks under sustained fire).
_reg_f("Bear", "bear_stagger_cd", 1.0, 0.0, 4.0, 0.05)
# ── Sword ─────────────────────────────────────────────────────────────────
# Local seating of the sword in the right hand (drawn / fighting).
# Defaults are identity — the bone is oriented in Blender to seat the sword
@@ -241,7 +305,7 @@ func _register_all() -> void:
_reg_f("Abilities", "kick_cooldown", 1.5, 0.2, 10.0, 0.1)
_reg_f("Abilities", "kick_range", 6.0, 0.5, 8.0, 0.1)
_reg_f("Abilities", "kick_strength", 12.0, 1.0, 30.0)
_reg_f("Abilities", "slam_cooldown", 4.0, 0.5, 15.0, 0.1)
_reg_f("Abilities", "slam_cooldown", 12, 0.5, 600, 0.1)
_reg_f("Abilities", "slam_jump_velocity", 7.0, 2.0, 20.0)
# Descent gravity multiplier — higher = faster crash, less airtime.
_reg_f("Abilities", "slam_fall_mult", 3.0, 1.0, 8.0, 0.5)
@@ -261,7 +325,7 @@ func _register_all() -> void:
# closest matador; on slamming one the ball POPS it (launched skyward via
# roll_knockup) then CHAINS to the next closest, up to roll_chain_count times.
# roll_turn is the homing turn rate. When no chain targets remain, the roll ends.
_reg_f("Roll", "roll_cooldown", 3.0, 0.5, 15.0, 0.1)
_reg_f("Roll", "roll_cooldown", 20, 0.5, 600, 0.1)
_reg_f("Roll", "roll_duration", 2.5, 0.5, 6.0, 0.1) # max roll time
_reg_f("Roll", "roll_chain_count", 2.0, 0.0, 8.0, 1.0) # extra matadors chained after the first
_reg_f("Roll", "roll_base_speed", 28.0, 5.0, 120.0) # speed at the start of the roll
@@ -299,6 +363,9 @@ func _register_all() -> void:
# Force the on-screen touch controls (joystick + ability buttons) on even on a
# desktop build — otherwise they appear only when a touchscreen is detected.
_reg_b("Touch", "force_touch_controls", false)
# On-screen readout of live touch state (event count, last position, active zone) so
# touch problems can be diagnosed on the actual device, where no console is reachable.
_reg_b("Touch", "touch_debug", false)
func _reg_f(section: String, key: String, default: float,
@@ -349,11 +416,40 @@ func get_all() -> Dictionary:
func save() -> void:
var cfg := ConfigFile.new()
var path := "res://debug_params.gd"
var file := FileAccess.open(path, FileAccess.READ)
if file == null:
push_error("DP.save: cannot open " + path)
return
var src := file.get_as_text()
file.close()
for key: String in _params:
var p: Dictionary = _params[key]
cfg.set_value(p["section"], key, p["value"])
cfg.save(SAVE_PATH)
if p["value"] == p["default"]:
continue
var re := RegEx.new()
if p["type"] == TYPE_FLOAT:
re.compile('(_reg_f\\("[^"]+",\\s*"%s",\\s*)([-\\d.e]+)' % key)
src = re.sub(src, "$1" + _fmt_float(p["value"] as float))
else:
re.compile('(_reg_b\\("[^"]+",\\s*"%s",\\s*)(true|false)' % key)
src = re.sub(src, "$1" + ("true" if bool(p["value"]) else "false"))
p["default"] = p["value"]
var wfile := FileAccess.open(path, FileAccess.WRITE)
if wfile == null:
push_error("DP.save: cannot write " + path)
return
wfile.store_string(src)
wfile.close()
func _fmt_float(v: float) -> String:
var s := "%.6g" % v
if not ("." in s or "e" in s):
s += ".0"
return s
func load_saved() -> void:
+21 -3
View File
@@ -34,10 +34,28 @@ commit=${GIT_COMMIT}
built=${BUILD_DATE}
EOF
# Cache-bust: give wasm/pck unique names so browsers never serve a stale build.
# index.js gets a ?v= query string; wasm/pck get renamed because the engine
# fetches them internally using GODOT_CONFIG.executable as the base name.
STAMP="$GIT_COMMIT"
cp "$BUILD_DIR/index.wasm" "$BUILD_DIR/index.${STAMP}.wasm"
cp "$BUILD_DIR/index.wasm.gz" "$BUILD_DIR/index.${STAMP}.wasm.gz"
cp "$BUILD_DIR/index.pck" "$BUILD_DIR/index.${STAMP}.pck"
sed -i \
-e "s|src=\"index\.js\"|src=\"index.js?v=${STAMP}\"|" \
-e "s|\"executable\":\"index\"|\"executable\":\"index.${STAMP}\"|" \
-e "s|\"index\.pck\"|\"index.${STAMP}.pck\"|g" \
-e "s|\"index\.wasm\"|\"index.${STAMP}.wasm\"|g" \
"$BUILD_DIR/index.html"
# Remove previous build's versioned assets from the server before uploading.
ssh "$SERVER_USER@$SERVER_HOST" "find $SERVER_PATH -maxdepth 1 -name 'index.*.wasm' -o -name 'index.*.wasm.gz' -o -name 'index.*.pck' | xargs -r rm -f"
scp "$BUILD_DIR/index.html" \
"$BUILD_DIR/index.js" \
"$BUILD_DIR/index.wasm.gz" \
"$BUILD_DIR/index.pck" \
"$BUILD_DIR/index.${STAMP}.wasm.gz" \
"$BUILD_DIR/index.${STAMP}.pck" \
"$BUILD_DIR/index.audio.worklet.js" \
"$BUILD_DIR/index.audio.position.worklet.js" \
"$BUILD_DIR/index.icon.png" \
@@ -46,4 +64,4 @@ scp "$BUILD_DIR/index.html" \
"$BUILD_DIR/version.txt" \
"$SERVER_USER@$SERVER_HOST:$SERVER_PATH/"
echo "deployed ${VERSION} to $SERVER_HOST:$SERVER_PATH"
echo "deployed ${VERSION} (${STAMP}) to $SERVER_HOST:$SERVER_PATH"
+88 -2
View File
@@ -1,18 +1,30 @@
[runnable_presets]
Web="Web"
"Windows Desktop"="Windows Desktop"
[preset.0]
name="Web"
platform="Web"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="build/web/index.html"
patches=PackedStringArray()
patch_delta_encoding=false
patch_delta_compression_level_zstd=19
patch_delta_min_reduction=0.1
patch_delta_include_filters="*"
patch_delta_exclude_filters=""
encryption_include_filters=""
encryption_exclude_filters=""
seed=0
encrypt_pck=false
encrypt_directory=false
script_export_mode=2
[preset.0.options]
@@ -21,7 +33,7 @@ custom_template/release=""
variant/extensions_support=false
variant/thread_support=true
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
vram_texture_compression/for_mobile=true
html/export_icon=true
html/custom_html_shell=""
html/head_include=""
@@ -29,6 +41,7 @@ html/canvas_resize_policy=2
html/focus_canvas_on_start=true
html/experimental_virtual_keyboard=false
progressive_web_app/enabled=false
progressive_web_app/ensure_cross_origin_isolation_headers=true
progressive_web_app/offline_page=""
progressive_web_app/display=1
progressive_web_app/orientation=0
@@ -36,3 +49,76 @@ progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color(0, 0, 0, 1)
threads/emscripten_pool_size=8
threads/godot_pool_size=4
[preset.1]
name="Windows Desktop"
platform="Windows Desktop"
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../Export/Bullosseum_020.exe"
patches=PackedStringArray()
patch_delta_encoding=false
patch_delta_compression_level_zstd=19
patch_delta_min_reduction=0.1
patch_delta_include_filters="*"
patch_delta_exclude_filters=""
encryption_include_filters=""
encryption_exclude_filters=""
seed=0
encrypt_pck=false
encrypt_directory=false
script_export_mode=2
[preset.1.options]
custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=1
binary_format/embed_pck=false
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
shader_baker/enabled=false
binary_format/architecture="x86_64"
codesign/enable=false
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PackedStringArray()
application/modify_resources=true
application/icon=""
application/console_wrapper_icon=""
application/icon_interpolation=4
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""
application/export_angle=0
application/export_d3d12=0
application/d3d12_agility_sdk_multiarch=true
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
$trigger = New-ScheduledTaskTrigger -Once -At 00:00
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
Start-ScheduledTask -TaskName godot_remote_debug
while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force '{temp_dir}'"
+37 -5
View File
@@ -71,6 +71,8 @@ var _result_win: bool = false
var _over_root: Control
var _over_video: VideoStreamPlayer
var _over_label: Label
var _over_continue: Button
var _over_again: Button
func _ready() -> void:
@@ -119,7 +121,11 @@ func _build_bottom_hud() -> void:
# Bull-head plate that sits behind the ability + health cluster. It's a sibling of the
# cluster (not a parent) so it never constrains the cluster's layout; we size and place
# it against the cluster's rect in _position_bull_bg.
# Skipped on touch/phone: the on-screen thumb cluster already crowds the bottom edge, so
# the wide horned plate just adds clutter there.
func _build_bull_hud_bg() -> void:
if Controls.use_touch_ui():
return
_bull_bg = TextureRect.new()
if ResourceLoader.exists(_BULL_BG):
_bull_bg.texture = load(_BULL_BG)
@@ -210,7 +216,10 @@ func _find_spawner() -> void:
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventKey and event.pressed and not event.echo:
if _game_over and event.physical_keycode in [KEY_ENTER, KEY_KP_ENTER]:
_restart()
if _result_win:
_continue_to_map()
else:
_restart()
elif event.physical_keycode == KEY_TAB and not _game_over:
_toggle_controls()
elif event.physical_keycode == KEY_ESCAPE:
@@ -229,6 +238,14 @@ func _restart() -> void:
get_tree().reload_current_scene()
# A cleared arena advances the run: commit the win and open the map to pick the next node.
func _continue_to_map() -> void:
get_tree().paused = false
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
Run.complete_current_level()
get_tree().change_scene_to_file("res://levels/MapScreen.tscn")
func _toggle_controls() -> void:
_controls_visible = not _controls_visible
_toggle_btn.text = "Hide controls" if _controls_visible else "Show controls"
@@ -240,7 +257,13 @@ func _toggle_controls() -> void:
# joystick and ability buttons instead. Shares Controls.use_touch_ui() with that
# overlay so exactly one control scheme shows on any given device.
func _update_control_hints() -> void:
if _game_over or Controls.use_touch_ui():
var touch := Controls.use_touch_ui()
# The desktop tiles carry keyboard keycaps that mean nothing on a phone, and their
# STOP-filtered panels would sit over the joystick zone eating touches — touch_controls
# shows its own ability buttons instead, so drop the desktop bar on touch devices.
if _ability_bar != null:
_ability_bar.visible = not touch
if _game_over or touch:
_controls_panel.visible = false
_tab_hint.visible = false
else:
@@ -301,6 +324,9 @@ func _show_game_over(win: bool, _cause: String = "") -> void:
await get_tree().create_timer(_WIN_DELAY if win else _LOSS_DELAY, false, false, true).timeout
_over_label.text = "Bull Won!" if _result_win else "Matadors Won!"
# A win advances the run (on to the map); a loss ends it (retry from the top).
_over_continue.visible = _result_win
_over_again.visible = not _result_win
var path := _WIN_VIDEO if _result_win else _LOSS_VIDEO
if ResourceLoader.exists(path):
@@ -371,9 +397,15 @@ func _build_game_over() -> void:
row.offset_bottom = -48.0
_over_root.add_child(row)
var again := _make_button("Go Again (Enter)")
again.pressed.connect(_restart)
row.add_child(again)
# Win → Continue to the run map; loss → Go Again from the top. Shown per-result in
# _show_game_over; both share the Enter shortcut.
_over_continue = _make_button("Continue (Enter)")
_over_continue.pressed.connect(_continue_to_map)
row.add_child(_over_continue)
_over_again = _make_button("Go Again (Enter)")
_over_again.pressed.connect(_restart)
row.add_child(_over_again)
var menu := _make_button("Main Menu")
menu.pressed.connect(_return_to_menu)
+10
View File
@@ -0,0 +1,10 @@
[gd_scene format=3 uid="uid://map_screen_v1"]
[ext_resource type="Script" path="res://levels/map_screen.gd" id="1_map"]
[node name="MapScreen" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource("1_map")
File diff suppressed because one or more lines are too long
+104
View File
@@ -0,0 +1,104 @@
extends CanvasLayer
const _GOLD := Color(1.00, 0.78, 0.22)
const _CREAM := Color(0.93, 0.88, 0.72)
const _BAR_W: float = 260.0
const _BAR_H: float = 18.0
const _BAR_BG: Color = Color(0.12, 0.04, 0.04, 0.88)
const _BAR_FILL: Color = Color(0.65, 0.08, 0.06)
const _BAR_ENRAGE: Color = Color(0.90, 0.32, 0.06)
var _bear: Node = null
var _fill: ColorRect = null
var _label: Label = null
var _max_hp: int = 1
var _current_hp: int = 1
func _ready() -> void:
layer = 10
_build_ui()
_find_bear.call_deferred()
func _find_bear() -> void:
var bears := get_tree().get_nodes_in_group(&"bear")
if bears.is_empty():
return
_bear = bears[0]
_bear.health_changed.connect(_on_health_changed)
_bear.killed.connect(_on_bear_killed)
var max_hp := int(DP.f("bear_max_hp"))
_on_health_changed(_bear.get_hp(), max_hp)
func _on_health_changed(current: int, max_hp: int) -> void:
_current_hp = current
_max_hp = max_hp
_update_bar()
func _on_bear_killed() -> void:
_current_hp = 0
_update_bar()
func _update_bar() -> void:
if _fill == null:
return
var frac := 0.0 if _max_hp <= 0 else clampf(float(_current_hp) / float(_max_hp), 0.0, 1.0)
_fill.size.x = _BAR_W * frac
var enrage_frac: float = DP.f("bear_enrage_frac")
_fill.color = _BAR_FILL.lerp(_BAR_ENRAGE, 1.0 - frac / enrage_frac if frac < enrage_frac else 0.0)
if _label != null:
_label.text = "BEAR %d / %d" % [maxi(_current_hp, 0), _max_hp]
func _build_ui() -> void:
var panel := PanelContainer.new()
panel.add_theme_stylebox_override(
"panel", UiTheme.plaque(UiTheme.LEATHER, UiTheme.BORDER, 4, 14.0, 8.0))
panel.anchor_left = 0.5
panel.anchor_right = 0.5
panel.anchor_top = 0.0
panel.anchor_bottom = 0.0
panel.grow_horizontal = Control.GROW_DIRECTION_BOTH
panel.offset_top = 16.0
panel.mouse_filter = Control.MOUSE_FILTER_IGNORE
add_child(panel)
var col := VBoxContainer.new()
col.add_theme_constant_override("separation", 5)
col.mouse_filter = Control.MOUSE_FILTER_IGNORE
panel.add_child(col)
_label = Label.new()
_label.text = "BEAR"
_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
_label.add_theme_font_override("font", UiFonts.body())
_label.add_theme_color_override("font_color", _GOLD)
_label.add_theme_color_override("font_outline_color", Color(0, 0, 0, 0.85))
_label.add_theme_constant_override("outline_size", 3)
_label.add_theme_font_size_override("font_size", 13)
_label.mouse_filter = Control.MOUSE_FILTER_IGNORE
col.add_child(_label)
var bar_bg := PanelContainer.new()
bar_bg.custom_minimum_size = Vector2(_BAR_W, _BAR_H)
bar_bg.clip_contents = true
var bg_style := StyleBoxFlat.new()
bg_style.bg_color = _BAR_BG
bg_style.set_corner_radius_all(4)
bg_style.corner_detail = 4
bg_style.border_width_bottom = 2
bg_style.border_color = Color(UiTheme.GOLD.r, UiTheme.GOLD.g, UiTheme.GOLD.b, 0.35)
bar_bg.add_theme_stylebox_override("panel", bg_style)
bar_bg.mouse_filter = Control.MOUSE_FILTER_IGNORE
col.add_child(bar_bg)
_fill = ColorRect.new()
_fill.color = _BAR_FILL
_fill.size = Vector2(_BAR_W, _BAR_H)
_fill.mouse_filter = Control.MOUSE_FILTER_IGNORE
bar_bg.add_child(_fill)
+1
View File
@@ -0,0 +1 @@
uid://dfk7dcvki7rqu
+49
View File
@@ -0,0 +1,49 @@
[gd_scene format=3 uid="uid://dfxigg3cr6nl5"]
[ext_resource type="PackedScene" uid="uid://bm6rmt3xprhjs" path="res://Assets/bear_level_arena.glb" id="1_beararena"]
[ext_resource type="Script" path="res://levels/bear_spawn.gd" id="2_spawn"]
[ext_resource type="PackedScene" path="res://Bear.tscn" id="3_bear"]
[ext_resource type="Script" path="res://levels/bear_hud.gd" id="4_bearhud"]
[sub_resource type="BoxShape3D" id="BoxShape3D_floor"]
[node name="bear_level" type="Node3D" unique_id=261730746]
[node name="Node3D" type="Node3D" parent="." unique_id=333447532]
[node name="StaticBody3D" type="StaticBody3D" parent="Node3D" unique_id=1466540248]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Node3D/StaticBody3D" unique_id=575454169]
transform = Transform3D(30, 0, 0, 0, 1, 0, 0, 0, 30, 0, -0.5, 0)
shape = SubResource("BoxShape3D_floor")
[node name="bear_level_arena" parent="." unique_id=1529242945 instance=ExtResource("1_beararena")]
transform = Transform3D(2.875, 0, 0, 0, 2.875, 0, 0, 0, 2.875, 0, 0, 0)
[node name="floor" parent="bear_level_arena/floor" parent_id_path=PackedInt32Array(1529242945, 41795043) index="0" unique_id=1653720920]
visible = false
[node name="wall" parent="bear_level_arena/floor" parent_id_path=PackedInt32Array(1529242945, 41795043) index="1" unique_id=2041884474]
visible = false
[node name="BearSpawner" type="Node3D" parent="." unique_id=47931969]
script = ExtResource("2_spawn")
enemy_scene = ExtResource("3_bear")
[node name="BearHud" type="CanvasLayer" parent="." unique_id=102938471]
script = ExtResource("4_bearhud")
[node name="Lights" type="Node3D" parent="." unique_id=937122836]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Lights" unique_id=1786336124]
transform = Transform3D(1, 0, 0, 0, 0.7071067, 0.70710677, 0, -0.70710677, 0.7071067, 0, 36.945946, 70)
light_color = Color(1, 0.75782466, 0.7332154, 1)
light_energy = 1.796
shadow_enabled = true
[node name="DirectionalLight3D2" type="DirectionalLight3D" parent="Lights" unique_id=1308313006]
transform = Transform3D(1, 0, 0, 0, -0.8660254, 0.49999994, 0, -0.49999994, -0.8660254, 0, 112.56815, 93.37274)
light_color = Color(0, 0.33367383, 0.57971, 1)
light_energy = 0.616
[editable path="bear_level_arena"]
+33
View File
@@ -0,0 +1,33 @@
extends Node3D
signal matador_killed
signal all_defeated
@export var enemy_scene: PackedScene = null
var _alive: int = 0
var _resolved: bool = false
func _ready() -> void:
add_to_group(&"matador_spawn")
_spawn.call_deferred()
func _spawn() -> void:
if enemy_scene == null:
return
var bear: Node3D = enemy_scene.instantiate()
bear.position = Vector3.ZERO
get_parent().add_child(bear)
if bear.has_signal(&"killed"):
bear.killed.connect(_on_bear_killed)
_alive += 1
func _on_bear_killed() -> void:
matador_killed.emit()
_alive -= 1
if not _resolved:
_resolved = true
all_defeated.emit()
+1
View File
@@ -0,0 +1 @@
uid://bbtlwihtlc1wp
+26
View File
@@ -0,0 +1,26 @@
extends Node3D
## The reusable game shell: player, camera, HUD and the PS1 filter — everything that
## outlives a single level. On load it instances the active level's module (geometry,
## spawners, lighting, colliders) into LevelRoot. Switching levels frees the whole
## previous module first, so no old mesh or collider can survive into the next fight.
@onready var _level_root: Node3D = $LevelRoot
func _ready() -> void:
Run.ensure_run()
load_active_level()
## Tear down the current level module and build the run's active one. Freeing the whole
## subtree (not hiding it) is the point: a level's colliders and spawners cease to exist
## before the next level's are created.
func load_active_level() -> void:
for child: Node in _level_root.get_children():
_level_root.remove_child(child)
child.queue_free()
var level := Run.active_level()
if level == null or level.level_scene == null:
push_warning("game_shell: active level has no level_scene")
return
_level_root.add_child(level.level_scene.instantiate())
+1
View File
@@ -0,0 +1 @@
uid://ptsfs3wq5bje
+26
View File
@@ -0,0 +1,26 @@
class_name LevelDef
extends Resource
## Definition of one playable level on the run map — the arena today, later a cave with
## a bear, a china shop to smash, and so on. Every map node references a LevelDef, and
## the map/flow code never hard-codes a scene: adding a level is a new LevelDef (plus its
## scene) handed out by the map generator in run_state.gd.
@export var id: StringName = &""
@export var display_name: String = "Level"
## The shell scene loaded when the player enters a node with this level — the reusable
## frame (player, camera, HUD, PS1 filter). Shared by every level; the level's own
## geometry rides in `level_scene`, which the shell instances at runtime.
@export_file("*.tscn") var scene_path: String = ""
## The level module instanced into the shell's LevelRoot: spawners, lighting, meshes,
## colliders and any level-specific subscripts. Swapped wholesale between levels so no
## previous level's geometry (or its colliders) can leak into the next.
@export var level_scene: PackedScene = null
## Placeholder pip tint on the map until per-level icon art exists.
@export var color: Color = Color(0.80, 0.62, 0.24)
## A boss level caps a run — its node is drawn larger and clearing it ends the map.
@export var is_boss: bool = false
## The enemy this level pits the bull against. Null → the usual matador wave (the
## spawner's default). Set → a single boss enemy of this scene is spawned instead (e.g.
## the bear), and the fight is won when it falls. The arena scene is shared either way;
## only the opponent changes.
@export var enemy_scene: PackedScene = null
+1
View File
@@ -0,0 +1 @@
uid://c6sef0tfl26sr
+13
View File
@@ -0,0 +1,13 @@
class_name MapNode
extends RefCounted
## One node on the run map. Regenerated every run and never persisted, so RefCounted
## rather than Resource. `pos` is normalized (0-1) so the map screen can lay the node out
## at any resolution; `links` are column indices in the *next* row this node connects to
## (the Slay-the-Spire branching path).
var row: int = 0
var col: int = 0
var pos: Vector2 = Vector2.ZERO
var level: LevelDef = null
var links: PackedInt32Array = PackedInt32Array()
var cleared: bool = false
+1
View File
@@ -0,0 +1 @@
uid://emq8i2bmkekn
+280
View File
@@ -0,0 +1,280 @@
extends Control
## Slay-the-Spire-style run map shown between fights. Placeholder art — coloured pips
## joined by paths — but fully interactive: the player picks one of the reachable nodes
## and is sent into that level. Every node is the arena for now (see run_state.gd); the
## screen is level-agnostic, so richer levels just need a LevelDef with its own colour.
const _GOLD := Color(1.00, 0.78, 0.22)
const _CREAM := Color(0.93, 0.88, 0.72)
const _EDGE_DIM := Color(0.45, 0.36, 0.18, 0.55)
const _EDGE_ACTIVE := Color(1.00, 0.82, 0.32, 0.95)
const _NODE_SIZE := 58.0
const _BOSS_SIZE := 88.0
const _MENU_SCENE := "res://MainMenu.tscn"
var _map_area: Control
var _completion: PanelContainer
func _ready() -> void:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
get_tree().paused = false
Run.ensure_run()
_build_ui()
_relayout.call_deferred() # defer so _map_area has its real size first
func _build_ui() -> void:
set_anchors_preset(Control.PRESET_FULL_RECT)
var bg := ColorRect.new()
bg.set_anchors_preset(Control.PRESET_FULL_RECT)
bg.color = Color(0.09, 0.06, 0.03) # opaque leather, no scene showing through
bg.mouse_filter = Control.MOUSE_FILTER_IGNORE
add_child(bg)
var title := Label.new()
title.text = "Choose Your Path"
title.set_anchors_preset(Control.PRESET_TOP_WIDE)
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
title.offset_top = 22.0
title.add_theme_font_override("font", UiFonts.title())
title.add_theme_font_size_override("font_size", 46)
title.add_theme_color_override("font_color", _GOLD)
title.add_theme_color_override("font_outline_color", Color(0, 0, 0, 0.9))
title.add_theme_constant_override("outline_size", 6)
title.mouse_filter = Control.MOUSE_FILTER_IGNORE
add_child(title)
_map_area = Control.new()
_map_area.set_anchors_preset(Control.PRESET_FULL_RECT)
_map_area.offset_top = 108.0
_map_area.offset_bottom = -92.0
_map_area.offset_left = 48.0
_map_area.offset_right = -48.0
_map_area.clip_contents = false
add_child(_map_area)
_map_area.resized.connect(_relayout)
var menu_btn := _make_button("Main Menu")
menu_btn.set_anchors_preset(Control.PRESET_BOTTOM_LEFT)
menu_btn.grow_vertical = Control.GROW_DIRECTION_BEGIN
menu_btn.offset_left = 32.0
menu_btn.offset_bottom = -26.0
menu_btn.pressed.connect(_to_menu)
add_child(menu_btn)
_build_completion()
# ── Layout ──────────────────────────────────────────────────────────────────
# Rebuilt from the run state on first show and whenever the map area resizes. Edges are
# added first so the node pips draw on top of the paths.
func _relayout() -> void:
if _map_area == null:
return
for child in _map_area.get_children():
child.queue_free()
var size := _map_area.size
if size.x <= 0.0 or size.y <= 0.0:
return
var reachable := Run.reachable()
var reach_set := {}
for n: MapNode in reachable:
reach_set[n] = true
var here := Run.current_node()
if Run.player_row < 0:
var start_pos := Vector2(size.x * 0.5, size.y - 8.0)
_add_start_pip(start_pos)
for n: MapNode in reachable:
_add_edge(start_pos, _local(n, size), true)
for row: Array in Run.map:
for from_node: MapNode in row:
for to_col: int in from_node.links:
var to_node := Run.node_at(from_node.row + 1, to_col)
if to_node == null:
continue
var active := from_node == here and reach_set.has(to_node)
_add_edge(_local(from_node, size), _local(to_node, size), active)
for row: Array in Run.map:
for node: MapNode in row:
_add_node(node, size, reach_set.has(node))
_completion.visible = Run.run_complete() or reachable.is_empty()
func _local(node: MapNode, size: Vector2) -> Vector2:
return Vector2(node.pos.x * size.x, node.pos.y * size.y)
func _add_edge(a: Vector2, b: Vector2, active: bool) -> void:
var line := Line2D.new()
line.add_point(a)
line.add_point(b)
line.width = 4.0 if active else 2.5
line.default_color = _EDGE_ACTIVE if active else _EDGE_DIM
line.antialiased = true
_map_area.add_child(line)
func _add_start_pip(center: Vector2) -> void:
var pip := PanelContainer.new()
var sz := 22.0
pip.custom_minimum_size = Vector2(sz, sz)
pip.size = Vector2(sz, sz)
pip.position = center - Vector2(sz, sz) * 0.5
pip.mouse_filter = Control.MOUSE_FILTER_IGNORE
pip.add_theme_stylebox_override("panel", UiTheme.disc(_GOLD, _CREAM, 2))
_map_area.add_child(pip)
func _add_node(node: MapNode, size: Vector2, is_reachable: bool) -> void:
var is_current := node.row == Run.player_row and node.col == Run.player_col
var sz := _BOSS_SIZE if node.level.is_boss else _NODE_SIZE
var center := _local(node, size)
var btn := Button.new()
btn.custom_minimum_size = Vector2(sz, sz)
btn.size = Vector2(sz, sz)
btn.position = center - Vector2(sz, sz) * 0.5
btn.focus_mode = Control.FOCUS_NONE
btn.disabled = not is_reachable
btn.mouse_filter = Control.MOUSE_FILTER_STOP if is_reachable else Control.MOUSE_FILTER_IGNORE
var fill := node.level.color
var border := UiTheme.BORDER
if is_current:
border = _CREAM
elif is_reachable:
border = _GOLD
elif node.cleared:
fill = fill.darkened(0.35)
border = Color(_GOLD.r, _GOLD.g, _GOLD.b, 0.5)
else: # locked — a future row not yet reachable
fill = fill.darkened(0.6)
border = Color(0.40, 0.34, 0.20, 0.6)
var border_w := 4 if (is_reachable or is_current) else 2
var normal := UiTheme.disc(fill, border, border_w)
var hover := UiTheme.disc(fill.lightened(0.18), _CREAM, border_w)
btn.add_theme_stylebox_override("normal", normal)
btn.add_theme_stylebox_override("hover", hover)
btn.add_theme_stylebox_override("pressed", hover)
btn.add_theme_stylebox_override("disabled", normal)
_map_area.add_child(btn)
if is_reachable:
btn.pressed.connect(_enter_node.bind(node))
_pulse(btn)
if is_reachable or is_current or node.level.is_boss:
_add_caption(node.level.display_name, center + Vector2(0.0, sz * 0.5 + 6.0), is_reachable)
if is_current:
_add_caption("You are here", center - Vector2(0.0, sz * 0.5 + 18.0), false)
func _add_caption(text: String, center_top: Vector2, bright: bool) -> void:
var lbl := Label.new()
lbl.text = text
lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
lbl.size = Vector2(200.0, 0.0)
lbl.position = center_top - Vector2(100.0, 0.0)
lbl.add_theme_font_override("font", UiFonts.body())
lbl.add_theme_font_size_override("font_size", 15)
lbl.add_theme_color_override("font_color", _CREAM if bright else UiTheme.MUTED)
lbl.add_theme_color_override("font_outline_color", Color(0, 0, 0, 0.9))
lbl.add_theme_constant_override("outline_size", 4)
lbl.mouse_filter = Control.MOUSE_FILTER_IGNORE
_map_area.add_child(lbl)
# Slow glow on the reachable pips so the eye lands on where the player can go next.
func _pulse(node: CanvasItem) -> void:
var tw := create_tween().set_loops()
tw.tween_property(node, "modulate:a", 0.6, 0.75).set_trans(Tween.TRANS_SINE)
tw.tween_property(node, "modulate:a", 1.0, 0.75).set_trans(Tween.TRANS_SINE)
# ── Actions ───────────────────────────────────────────────────────────────────
func _enter_node(node: MapNode) -> void:
Run.select_node(node)
get_tree().paused = false
get_tree().change_scene_to_file(node.level.scene_path)
func _to_menu() -> void:
get_tree().paused = false
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
get_tree().change_scene_to_file(_MENU_SCENE)
# ── Run-complete overlay ──────────────────────────────────────────────────────
func _build_completion() -> void:
_completion = PanelContainer.new()
_completion.set_anchors_preset(Control.PRESET_CENTER)
_completion.grow_horizontal = Control.GROW_DIRECTION_BOTH
_completion.grow_vertical = Control.GROW_DIRECTION_BOTH
_completion.add_theme_stylebox_override(
"panel", UiTheme.plaque(UiTheme.LEATHER, _GOLD, 4, 32.0, 24.0)
)
_completion.visible = false
add_child(_completion)
var col := VBoxContainer.new()
col.add_theme_constant_override("separation", 16)
col.alignment = BoxContainer.ALIGNMENT_CENTER
_completion.add_child(col)
var heading := Label.new()
heading.text = "Run Complete!"
heading.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
heading.add_theme_font_override("font", UiFonts.title())
heading.add_theme_font_size_override("font_size", 40)
heading.add_theme_color_override("font_color", _GOLD)
heading.add_theme_color_override("font_outline_color", Color(0, 0, 0, 0.9))
heading.add_theme_constant_override("outline_size", 5)
col.add_child(heading)
var row := HBoxContainer.new()
row.alignment = BoxContainer.ALIGNMENT_CENTER
row.add_theme_constant_override("separation", 16)
col.add_child(row)
var again := _make_button("New Run")
again.pressed.connect(_new_run)
row.add_child(again)
var menu := _make_button("Main Menu")
menu.pressed.connect(_to_menu)
row.add_child(menu)
func _new_run() -> void:
Run.start_new_run()
_relayout()
# Shared thematic button, matching the HUD / menu plaques.
func _make_button(text: String) -> Button:
var btn := Button.new()
btn.text = text
btn.focus_mode = Control.FOCUS_NONE
btn.add_theme_stylebox_override(
"normal", UiTheme.plaque(Color(0.10, 0.07, 0.03, 0.90), _GOLD, 3, 18.0, 9.0)
)
var hover := UiTheme.plaque(Color(0.16, 0.10, 0.04, 0.96), _CREAM, 3, 18.0, 9.0)
btn.add_theme_stylebox_override("hover", hover)
btn.add_theme_stylebox_override("pressed", hover)
btn.add_theme_font_override("font", UiFonts.body())
btn.add_theme_color_override("font_color", _GOLD)
btn.add_theme_color_override("font_hover_color", _CREAM)
btn.add_theme_font_size_override("font_size", 18)
return btn
+1
View File
@@ -0,0 +1 @@
uid://dt3ffakbwlkmc
+76
View File
@@ -0,0 +1,76 @@
extends Node3D
signal matador_killed
signal all_defeated
const MATADOR := preload("res://Matador.tscn")
var _alive: int = 0
var _wave: int = 0
var _resolved: bool = false
var _spawn_points: Array[Node3D] = []
func _ready() -> void:
add_to_group(&"matador_spawn")
_spawn.call_deferred()
# Each spawner node is a spawn-point marker. The first in tree order (the one the HUD
# connects its all_defeated to) runs the wave logic and uses every marker — itself and
# its siblings — as an entry point; the rest stay passive so waves aren't run four times.
func _spawn() -> void:
var markers := get_tree().get_nodes_in_group(&"matador_spawn")
if markers.is_empty() or markers[0] != self:
return
for node: Node in markers:
if node is Node3D:
_spawn_points.append(node as Node3D)
_place_bull(randf() * TAU, DP.f("arena_spawn_radius"))
_start_next_wave()
# Wave 1 sends 1 matador, wave 2 sends 2, … up to the number of placed spawn points.
# Matadors are assigned to a random subset of spawn points each wave and enter staggered.
func _start_next_wave() -> void:
_wave += 1
var count := mini(_wave, _spawn_points.size())
var points: Array = _spawn_points.duplicate()
points.shuffle()
for i: int in count:
var sp := points[i] as Node3D
var m := _spawn_at(sp.global_position)
m.call_deferred(&"enter_spawn_roll", Vector3.ZERO)
if i < count - 1:
await get_tree().create_timer(DP.f("mat_spawn_stagger")).timeout
func _place_bull(angle: float, arena_r: float) -> void:
var bull := get_tree().get_first_node_in_group(&"player") as Node3D
if not bull:
return
bull.global_position = Vector3(
cos(angle) * arena_r, bull.global_position.y, sin(angle) * arena_r
)
func _spawn_at(pos: Vector3) -> Node3D:
var m: Node3D = MATADOR.instantiate()
m.position = pos
get_parent().add_child(m)
m.killed.connect(_on_matador_killed)
_alive += 1
return m
func _on_matador_killed() -> void:
matador_killed.emit()
_alive -= 1
if _alive > 0 or _resolved:
return
if _wave >= _spawn_points.size():
_resolved = true
all_defeated.emit()
else:
await get_tree().create_timer(DP.f("mat_wave_pause")).timeout
_start_next_wave()
+246
View File
@@ -0,0 +1,246 @@
extends Node
## Persistent run progression across scene changes — the Slay-the-Spire-style map and
## where the player sits on it. The arena scene is reloaded for every fight, so this
## state must outlive scene changes: genuinely global run state earns an autoload (`Run`).
##
## Flow: menu Play → start_new_run() → arena (intro fight) → win → MapScreen shows the
## first frontier → pick a node → its level scene → win → back to MapScreen advanced one
## row, and on until a boss node ends the map. Every node is the arena for now; adding a
## level later is a new LevelDef in the catalog and pointing the generator at it.
signal run_started
# Every level loads the same reusable shell (player, camera, HUD, PS1 filter); the shell
# then instances the level's own `level_scene` module into its LevelRoot.
const _SHELL_SCENE := "res://scene.tscn"
const _ARENA_LEVEL := preload("res://levels/arena_level.tscn")
const _BEAR_LEVEL := preload("res://levels/bear_level.tscn")
# Map shape. Small + placeholder for now; the final row is a single boss node.
const _ROWS := 5
const _MIN_PER_ROW := 2
const _MAX_PER_ROW := 4
## map[row] is an Array[MapNode]; empty until a run starts.
var map: Array = []
## Node the player currently occupies. (-1, -1) = the start gate below the first row —
## i.e. straight after the intro fight, before any map node has been chosen.
var player_row: int = -1
var player_col: int = -1
## Node picked on the map whose level is being played now; committed to on the next win.
var pending_row: int = -1
var pending_col: int = -1
## Debug override — when set, active_level() returns this regardless of map state.
## Set via the console `level` command; cleared on start_new_run().
var debug_level_override: LevelDef = null
# Level catalog. Every level shares the shell scene; what changes is the level module
# (its geometry + spawners) and the opponent. The arena (matador wave, normal + boss
# flavours) and the bear (a lone boss enemy that can turn up as a normal node) live here.
# Future levels — china shop — slot in the same way: a new module + a LevelDef entry.
const _BEAR_SCENE := preload("res://Bear.tscn")
var _arena: LevelDef
var _arena_boss: LevelDef
var _bear: LevelDef
func _ready() -> void:
_arena = _make_level(&"arena", "The Arena", _ARENA_LEVEL, Color(0.80, 0.62, 0.24), false)
_arena_boss = _make_level(
&"arena_boss", "Grand Arena", _ARENA_LEVEL, Color(0.88, 0.30, 0.20), true
)
_bear = _make_level(&"bear", "Bear's Den", _BEAR_LEVEL, Color(0.55, 0.38, 0.22), false)
_bear.enemy_scene = _BEAR_SCENE
func _make_level(
id: StringName, level_name: String, level_scene: PackedScene, color: Color, boss: bool
) -> LevelDef:
var l := LevelDef.new()
l.id = id
l.display_name = level_name
l.scene_path = _SHELL_SCENE
l.level_scene = level_scene
l.color = color
l.is_boss = boss
return l
## The level being fought right now: debug override wins, then the pending/current map
## node, falling back to the plain arena for the intro fight or a direct scene launch.
func active_level() -> LevelDef:
if debug_level_override != null:
return debug_level_override
var n := node_at(pending_row, pending_col)
if n == null:
n = current_node()
return n.level if n != null and n.level != null else _arena
## Return a level by id, or null if unknown. Used by the debug console `level` command.
func get_level(id: StringName) -> LevelDef:
match id:
&"arena": return _arena
&"arena_boss": return _arena_boss
&"bear": return _bear
return null
## All known level ids — shown by `level` in the console.
func level_ids() -> Array[StringName]:
return [&"arena", &"arena_boss", &"bear"]
## Begin a fresh run: build a new map and place the player at the start gate. Called from
## the main-menu Play button, not from the arena scene (which reloads for every fight).
func start_new_run() -> void:
_generate_map()
player_row = -1
player_col = -1
pending_row = -1
pending_col = -1
debug_level_override = null
run_started.emit()
## Build a run if none exists — a safety net for entering the map or arena directly (e.g.
## running scene.tscn straight from the editor) without coming through the menu.
func ensure_run() -> void:
if map.is_empty():
start_new_run()
func has_run() -> bool:
return not map.is_empty()
func node_at(row: int, col: int) -> MapNode:
if row < 0 or row >= map.size():
return null
var r: Array = map[row]
if col < 0 or col >= r.size():
return null
return r[col]
func current_node() -> MapNode:
return node_at(player_row, player_col)
## Nodes the player may pick next: the whole first row from the start gate, otherwise the
## nodes the current node links forward to.
func reachable() -> Array:
if map.is_empty():
return []
if player_row < 0:
return (map[0] as Array).duplicate()
var here := current_node()
if here == null or player_row + 1 >= map.size():
return []
var out: Array = []
for c: int in here.links:
var n := node_at(player_row + 1, c)
if n != null:
out.append(n)
return out
## True once the player has cleared a boss node — the map is finished.
func run_complete() -> bool:
var here := current_node()
return here != null and here.level != null and here.level.is_boss
## Mark a node as the one being played (its level scene is about to load).
func select_node(node: MapNode) -> void:
if node == null:
return
pending_row = node.row
pending_col = node.col
## Commit the level just won: move the player onto the pending node (or leave them at the
## start gate after the intro fight, which has no pending node).
func complete_current_level() -> void:
if pending_row >= 0:
player_row = pending_row
player_col = pending_col
var n := current_node()
if n != null:
n.cleared = true
pending_row = -1
pending_col = -1
# ── Map generation ────────────────────────────────────────────────────────────
# A small branching lattice: each row gets a handful of nodes, each node links to the
# nearest node(s) in the next row, and every next-row node is guaranteed a parent so the
# path is always connected (no orphan the player can never reach). The final row is a
# single boss node the whole map funnels toward.
func _generate_map() -> void:
map.clear()
for r: int in _ROWS:
var count := 1 if r == _ROWS - 1 else randi_range(_MIN_PER_ROW, _MAX_PER_ROW)
var y := 1.0 - float(r + 1) / float(_ROWS + 1) # row 0 near the bottom, boss on top
var row_nodes: Array = []
for c: int in count:
var node := MapNode.new()
node.row = r
node.col = c
node.pos = Vector2(_column_x(c, count), y)
# Boss row is always the Grand Arena; normal nodes are a mix of matador
# arenas and the occasional Bear's Den for variety.
if r == _ROWS - 1:
node.level = _arena_boss
else:
node.level = _bear if randf() < 0.35 else _arena
row_nodes.append(node)
map.append(row_nodes)
_link_rows()
func _column_x(col: int, count: int) -> float:
if count <= 1:
return 0.5
return lerpf(0.18, 0.82, float(col) / float(count - 1))
func _link_rows() -> void:
for r: int in _ROWS - 1:
var cur: Array = map[r]
var nxt: Array = map[r + 1]
var incoming := PackedInt32Array()
incoming.resize(nxt.size()) # zero-filled
for from_node: MapNode in cur:
var nearest := _nearest_index(from_node, nxt)
_add_link(from_node, nearest, incoming)
# Occasionally fan out to an adjacent next-row node so paths branch.
if nxt.size() > 1 and randf() < 0.45:
var step := 1 if randf() < 0.5 else -1
_add_link(from_node, clampi(nearest + step, 0, nxt.size() - 1), incoming)
# Guarantee every next-row node has at least one parent (no orphans).
for c: int in nxt.size():
if incoming[c] == 0:
_add_link(cur[_nearest_index(nxt[c], cur)], c, incoming)
func _add_link(from_node: MapNode, to_col: int, incoming: PackedInt32Array) -> void:
if to_col in from_node.links:
return
from_node.links.append(to_col)
incoming[to_col] += 1
# Index of the node in `others` whose column position is closest to `node` on the x axis —
# used both to link a node forward and to adopt an orphan back to its nearest parent.
func _nearest_index(node: MapNode, others: Array) -> int:
var best := 0
var best_d := INF
for i: int in others.size():
var d: float = absf((others[i] as MapNode).pos.x - node.pos.x)
if d < best_d:
best_d = d
best = i
return best
+1
View File
@@ -0,0 +1 @@
uid://u4fartm52bk3
+68 -6
View File
@@ -190,13 +190,74 @@ func _process(_delta: float) -> void:
play_button.anchor_bottom = cape.y
# Player-facing option toggles, seated above the rebind list in the Options panel:
# the master screen-shake switch and the gore toggle (both persisted via Settings).
# Player-facing option toggles and audio sliders, seated above the rebind list.
func _build_options_toggles() -> void:
var scroll_idx := options_scroll.get_index()
# Insert in reverse so both land directly above the rebind scroll, in listed order.
_add_toggle_row("Blood & Gore", Settings.gore, Settings.set_gore, scroll_idx)
_add_toggle_row("Screen Shake", Settings.screen_shake, Settings.set_screen_shake, scroll_idx)
var idx := options_scroll.get_index()
_add_section_label("── Audio ──", idx); idx += 1
_add_slider_row("Master Volume", Settings.volume_master, Settings.set_volume_master, idx); idx += 1
_add_slider_row("Ambient Volume", Settings.volume_ambient, Settings.set_volume_ambient, idx); idx += 1
_add_slider_row("Effects Volume", Settings.volume_effects, Settings.set_volume_effects, idx); idx += 1
_add_toggle_row("Mute All", Settings.mute_all, Settings.set_mute_all, idx); idx += 1
_add_section_label("── Gameplay ──", idx); idx += 1
_add_toggle_row("Screen Shake", Settings.screen_shake, Settings.set_screen_shake, idx); idx += 1
_add_toggle_row("Blood & Gore", Settings.gore, Settings.set_gore, idx); idx += 1
_add_section_label("── Controls ──", idx)
func _add_section_label(text: String, at_index: int) -> void:
var lbl := Label.new()
lbl.text = text
lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
lbl.size_flags_horizontal = Control.SIZE_EXPAND_FILL
lbl.add_theme_font_override("font", UiFonts.title())
lbl.add_theme_font_size_override("font_size", 18)
lbl.add_theme_color_override("font_color", MENU_GOLD)
lbl.add_theme_color_override("font_outline_color", Color.BLACK)
lbl.add_theme_constant_override("outline_size", 4)
options_vbox.add_child(lbl)
options_vbox.move_child(lbl, at_index)
func _add_slider_row(label_text: String, value: float, setter: Callable, at_index: int) -> void:
var row := HBoxContainer.new()
row.size_flags_horizontal = Control.SIZE_EXPAND_FILL
var name_label := Label.new()
name_label.text = label_text
name_label.custom_minimum_size = Vector2(160, 0)
name_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
name_label.add_theme_font_override("font", UiFonts.body())
name_label.add_theme_font_size_override("font_size", 20)
name_label.add_theme_color_override("font_color", MENU_CREAM)
name_label.add_theme_color_override("font_outline_color", Color.BLACK)
name_label.add_theme_constant_override("outline_size", 5)
row.add_child(name_label)
var slider := HSlider.new()
slider.min_value = 0.0
slider.max_value = 1.0
slider.step = 0.01
slider.value = value
slider.size_flags_horizontal = Control.SIZE_EXPAND_FILL
slider.custom_minimum_size = Vector2(0, 28)
row.add_child(slider)
var pct_label := Label.new()
pct_label.text = "%d%%" % roundi(value * 100.0)
pct_label.custom_minimum_size = Vector2(46, 0)
pct_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
pct_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
pct_label.add_theme_font_override("font", UiFonts.body())
pct_label.add_theme_font_size_override("font_size", 18)
pct_label.add_theme_color_override("font_color", MENU_GOLD)
row.add_child(pct_label)
slider.value_changed.connect(func(v: float) -> void:
setter.call(v)
pct_label.text = "%d%%" % roundi(v * 100.0))
options_vbox.add_child(row)
options_vbox.move_child(row, at_index)
func _add_toggle_row(label_text: String, value: bool, setter: Callable, at_index: int) -> void:
@@ -254,6 +315,7 @@ func _build_rebind_rows() -> void:
func _on_play_pressed() -> void:
_set_buttons_disabled(true)
Run.start_new_run() # fresh map for this run; the arena is the intro fight
var tween := create_tween()
tween.tween_property(fade_rect, "color:a", 1.0, FADE_TIME)
tween.tween_callback(func() -> void:
+31
View File
@@ -35,6 +35,7 @@ var _swing_timer: float = 0.0
var _lunge_timer: float = 0.0
var _roll_timer: float = 0.0
var _roll_dir: Vector3 = Vector3.ZERO
var _is_spawning: bool = false
var _throw_timer: float = 0.0
var _throw_aim_cd: float = 0.0
var _throw_dir: Vector3 = Vector3.ZERO
@@ -92,12 +93,19 @@ const _TURN_FACE: float = 16.0 # face the bull while engaging
const _TURN_SHARP: float = 24.0 # snap onto a sidestep / roll direction
const RigidSkin = preload("res://rigid_skin.gd")
func _ready() -> void:
add_to_group(&"matador")
_skeleton = _find_skeleton(_mesh)
_anim_player = _find_anim_player(_mesh)
if _skeleton:
_sim = MatadorRagdoll.build(_skeleton)
# Web (Mali/ANGLE) can't run Compatibility vertex-skinning; rebuild as non-skinned
# bone-attached pieces. Runs after the ragdoll sim is built (both drive the same bones).
if OS.has_feature("web"):
RigidSkin.convert_tree(self)
if _anim_player:
for anim in [_ANIM_RUN, _ANIM_ATTACK] + _ANIM_TAUNTS:
_ensure_loop(anim)
@@ -118,11 +126,13 @@ func _ready() -> void:
_ole_player = AudioStreamPlayer.new()
_ole_player.stream = load("res://sounds/ole.ogg")
_ole_player.volume_db = 0.0
_ole_player.bus = &"Effects"
add_child(_ole_player)
if ResourceLoader.exists("res://sounds/matador_death.ogg"):
_death_player = AudioStreamPlayer.new()
_death_player.stream = load("res://sounds/matador_death.ogg")
_death_player.volume_db = 2.0
_death_player.bus = &"Effects"
add_child(_death_player)
@@ -143,6 +153,10 @@ func _acquire_bull() -> void:
func _physics_process(delta: float) -> void:
_acquire_bull()
if _is_spawning and is_on_floor():
_is_spawning = false
collision_layer = 1
if DP.b("show_raycasts") and _steer_dir != Vector3.ZERO:
var o := global_position + Vector3.UP * 0.6
DebugDraw.ray(o, o + _steer_dir * _STEER_LOOKAHEAD, Color(0.3, 1.0, 0.9))
@@ -564,6 +578,23 @@ func _enter_roll(hit_dir: Vector3) -> void:
_anim_player.seek(0.0, true)
# Called by the spawner (deferred) to make the matador leap-roll toward a target
# point on entry — the cinematic arena entrance. After the roll it transitions to
# normal AI via the standard ROLL → FLEE path.
func enter_spawn_roll(toward: Vector3) -> void:
var dir := toward - global_position
dir.y = 0.0
_roll_dir = dir.normalized() if dir.length() > 0.1 else -_mesh.global_transform.basis.z
_state = State.ROLL
_roll_timer = _anim_length(_ANIM_ROLL, DP.f("mat_roll_duration"))
_is_spawning = true
collision_layer = 0
velocity.y = 4.0
if _anim_player and _anim_player.has_animation(_ANIM_ROLL):
_anim_player.play(_ANIM_ROLL)
_anim_player.seek(0.0, true)
func _tick_roll(delta: float) -> void:
_roll_timer -= delta
if _roll_timer <= 0.0:
-142
View File
@@ -1,142 +0,0 @@
extends Node3D
signal matador_killed
signal all_defeated
const MATADOR := preload("res://Matador.tscn")
var _spawn_count: int = 1
var _alive: int = 0
var _kills: int = 0
var _resolved: bool = false
# Flat (x,z) positions of the most recent batch spawned. A fresh wave keeps at least
# _SPAWN_MIN_SEP away from these so it never lands on top of where the last one did.
const _SPAWN_MIN_SEP: float = 3.5
var _last_spawn_positions: Array[Vector3] = []
func _ready() -> void:
add_to_group(&"matador_spawn")
_spawn_count = maxi(1, int(DP.f("mat_spawn_count")))
# Deferred so it's safe from _ready and matches the previous spawn timing.
_spawn.call_deferred()
func _spawn() -> void:
# Bull and matadors start at opposite ends of a random diameter, so they always
# begin as far apart as the arena allows (edge-to-edge across the centre).
var arena_r := DP.f("arena_spawn_radius")
var bull_angle := randf() * TAU
_place_bull(bull_angle, arena_r)
var placed: Array[Vector3] = _spread_positions(_spawn_count, bull_angle + PI, arena_r)
for pos: Vector3 in placed:
_spawn_at(pos)
_last_spawn_positions = placed
func _place_bull(angle: float, arena_r: float) -> void:
var bull := get_tree().get_first_node_in_group(&"player") as Node3D
if not bull:
return
bull.global_position = Vector3(
cos(angle) * arena_r, bull.global_position.y, sin(angle) * arena_r
)
# Positions for the matadors, spread across the far side (centred on `center_angle`)
# so every matador stays near the point diametrically opposite the bull. Each slot gets
# its own angular band and a staggered radius, then rejection-samples inside that band so
# no two matadors land closer than _SPAWN_MIN_SEP — otherwise they pile up on top of
# each other on spawn. The arc widens with the crowd so a big wave doesn't get cramped.
func _spread_positions(count: int, center_angle: float, arena_r: float) -> Array[Vector3]:
var positions: Array[Vector3] = []
if count <= 1:
positions.append(Vector3(cos(center_angle) * arena_r, 1.0, sin(center_angle) * arena_r))
return positions
var arc := clampf(TAU * 0.33 + float(count) * 0.25, TAU * 0.33, TAU * 0.92)
var slot := arc / float(count)
var inner := maxf(2.5, arena_r * 0.5)
for i: int in count:
# Give each matador its own angular slot for an even fan, but sample the radius
# freely across the whole far-side band so the rejection test can push crowded
# neighbours onto a different ring instead of piling them at one distance.
var base_angle := center_angle - arc * 0.5 + slot * (float(i) + 0.5)
var pos := Vector3(cos(base_angle) * arena_r, 1.0, sin(base_angle) * arena_r)
for attempt: int in 16:
var angle := base_angle + randf_range(-0.5, 0.5) * slot
var radius := randf_range(inner, arena_r)
pos = Vector3(cos(angle) * radius, 1.0, sin(angle) * radius)
if _clear_of(pos, positions, _SPAWN_MIN_SEP):
break
positions.append(pos)
return positions
func _spawn_at(pos: Vector3, generation: int = 0) -> void:
var m: Node3D = MATADOR.instantiate()
m.position = pos
m.set_meta(&"generation", generation)
get_parent().add_child(m)
m.killed.connect(_on_matador_killed.bind(m))
_alive += 1
# A slain matador is replaced by mat_split_factor fresh ones on the spot (a hydra),
# so the horde doubles each generation, up to mat_split_generations deep. The bull
# wins only when a whole generation dies out without splitting — i.e. once the spawns
# stop and the last body drops.
func _on_matador_killed(dead: Node3D) -> void:
matador_killed.emit()
_alive -= 1
_kills += 1
_split(dead)
var win_kills := int(DP.f("mat_win_kills"))
var reached_quota := win_kills > 0 and _kills >= win_kills
if (reached_quota or _alive <= 0) and not _resolved:
_resolved = true
all_defeated.emit()
func _split(dead: Node3D) -> void:
var count := int(DP.f("mat_split_factor"))
var generation := int(dead.get_meta(&"generation", 0))
if count < 2 or generation >= int(DP.f("mat_split_generations")):
return
var arena_r := DP.f("arena_spawn_radius")
var origin := dead.global_position
origin.y = 0.0
var wave: Array[Vector3] = []
for i: int in count:
var pos := _pick_spawn(origin, arena_r, wave)
wave.append(pos)
_spawn_at(pos, generation + 1)
_last_spawn_positions = wave
# Rejection-sample a spawn point ringed around `origin`, pushing the ring outward on
# each failed attempt until it clears both the previous wave (_last_spawn_positions)
# and the spots already taken this wave — so a fresh wave never lands where the last
# one did. Falls back to the last candidate if the arena is too cramped to satisfy it.
func _pick_spawn(origin: Vector3, arena_r: float, taken: Array[Vector3]) -> Vector3:
var pos := origin
for attempt: int in 12:
var angle := randf() * TAU
var r := randf_range(2.0, 3.5) + float(attempt) * 0.4
pos = origin + Vector3(cos(angle) * r, 0.0, sin(angle) * r)
var flat := Vector2(pos.x, pos.z)
if flat.length() > arena_r:
flat = flat.normalized() * arena_r
pos = Vector3(flat.x, 0.0, flat.y)
if _clear_of(pos, _last_spawn_positions, _SPAWN_MIN_SEP) \
and _clear_of(pos, taken, _SPAWN_MIN_SEP):
break
pos.y = 1.0
return pos
func _clear_of(pos: Vector3, others: Array[Vector3], min_sep: float) -> bool:
for o: Vector3 in others:
if Vector2(pos.x - o.x, pos.z - o.z).length() < min_sep:
return false
return true
+63
View File
@@ -0,0 +1,63 @@
extends CanvasLayer
## Universal "rotate to landscape" prompt (autoload `OrientationGuard`). The cross-device
## half of landscape enforcement: screen.orientation.lock (controls_manager.gd) handles
## Android, but iOS Safari has no lock API, and some browsers only lock in fullscreen — so
## wherever the device ends up portrait, we simply ask the player to turn it. No canvas
## rotation or input remapping (those break touch coordinates), so it works on every phone
## and browser cleanly. Only ever shows on touch-primary devices, only while portrait.
var _panel: ColorRect
func _ready() -> void:
layer = 128 # above HUD, touch UI, everything
process_mode = Node.PROCESS_MODE_ALWAYS
_panel = ColorRect.new()
_panel.color = Color(0.05, 0.03, 0.02, 0.97)
_panel.set_anchors_preset(Control.PRESET_FULL_RECT)
_panel.mouse_filter = Control.MOUSE_FILTER_STOP # swallow taps to the game behind it
_panel.visible = false
add_child(_panel)
var center := CenterContainer.new()
center.set_anchors_preset(Control.PRESET_FULL_RECT)
center.mouse_filter = Control.MOUSE_FILTER_IGNORE
_panel.add_child(center)
var box := VBoxContainer.new()
box.alignment = BoxContainer.ALIGNMENT_CENTER
box.add_theme_constant_override("separation", 14)
center.add_child(box)
var title := Label.new()
title.text = "Rotate your device"
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
title.add_theme_font_size_override("font_size", 44)
title.add_theme_color_override("font_color", Color(1.0, 0.78, 0.22))
box.add_child(title)
var sub := Label.new()
sub.text = "Turn it sideways to play in landscape"
sub.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
sub.add_theme_font_size_override("font_size", 22)
sub.add_theme_color_override("font_color", Color(0.85, 0.85, 0.85))
box.add_child(sub)
get_viewport().size_changed.connect(_update)
_update.call_deferred()
func _update() -> void:
_panel.visible = _should_guard() and _is_portrait()
func _is_portrait() -> bool:
var s := get_viewport().get_visible_rect().size
return s.y > s.x
# Touch-primary devices only — never a desktop browser with a tall window (they can't rotate
# a monitor). Reuses the same conservative detection the touch UI uses.
func _should_guard() -> bool:
return Controls.use_touch_ui()
+1
View File
@@ -0,0 +1 @@
uid://cmh7kd85wi5gx
+31 -11
View File
@@ -14,7 +14,9 @@ const _ANIM_IDLE: StringName = &"Armature|IDLE"
const _ANIM_KICK: StringName = &"Armature|KICK"
const _ANIM_SLAM: StringName = &"Armature|SLAM"
const _ANIM_DASH: StringName = &"Armature|DASH"
const _ANIM_WALK: StringName = &"Armature|WALK"
const _ANIM_ROLL: StringName = &"Armature|ROLL"
const _ANIM_DEATH: StringName = &"Armature|DEATH"
@onready var camera_pivot: Node3D = $Camera3D
@onready var cube_guy: Node3D = $bull
@@ -77,8 +79,16 @@ var _walk_dust_ramp: Gradient = null
var _charge_dust_ramp: Gradient = null
const RigidSkin = preload("res://rigid_skin.gd")
func _ready() -> void:
add_to_group(&"player")
# Mali/ANGLE mobile GPUs can't run Godot's Compatibility vertex-skinning (transform
# feedback) — skinned meshes render invisible on the web build. Rebuild the bull as
# non-skinned bone-attached pieces there; desktop keeps smooth GPU skinning.
if OS.has_feature("web"):
RigidSkin.convert_tree(self)
_max_hp = maxi(1, int(DP.f("bull_max_hp")))
_hp = _max_hp
_cube_scale = cube_guy.scale
@@ -100,16 +110,16 @@ func _setup_legs() -> void:
func _setup_hoof_dust() -> void:
var sphere := _particle_sphere(0.10, 4, 2, _unshaded_material())
var sphere := _particle_sphere(0.07, 4, 2, _unshaded_material())
_walk_dust_ramp = Gradient.new()
_walk_dust_ramp.set_color(0, Color(0.80, 0.69, 0.46, 1.0))
_walk_dust_ramp.set_color(1, Color(0.80, 0.69, 0.46, 0.0))
_walk_dust_ramp.set_color(0, Color(0.94, 0.90, 0.83, 1.0))
_walk_dust_ramp.set_color(1, Color(0.94, 0.90, 0.83, 0.0))
# Light blue dust while charging
# White-beige dust while running
_charge_dust_ramp = Gradient.new()
_charge_dust_ramp.set_color(0, Color(0.20, 0.40, 0.85, 1.0))
_charge_dust_ramp.set_color(1, Color(0.20, 0.40, 0.85, 0.0))
_charge_dust_ramp.set_color(0, Color(0.94, 0.90, 0.83, 1.0))
_charge_dust_ramp.set_color(1, Color(0.94, 0.90, 0.83, 0.0))
var scale_curve := Curve.new()
scale_curve.add_point(Vector2(0.0, 0.2))
@@ -213,6 +223,7 @@ func _setup_audio() -> void:
_huff_player = AudioStreamPlayer.new()
_huff_player.stream = load("res://sounds/bull_huff.ogg")
_huff_player.volume_db = 0.0
_huff_player.bus = &"Effects"
add_child(_huff_player)
if ResourceLoader.exists("res://sounds/crowd_ambient.ogg"):
_crowd_player = AudioStreamPlayer.new()
@@ -222,6 +233,7 @@ func _setup_audio() -> void:
_crowd_player.stream = s
_crowd_player.volume_db = -14.0
_crowd_player.autoplay = true
_crowd_player.bus = &"Ambient"
add_child(_crowd_player)
@@ -251,8 +263,8 @@ func _set_dust_state(new_state: DustState) -> void:
p.initial_velocity_min = DP.f("charge_vel_min")
p.initial_velocity_max = DP.f("charge_vel_max")
p.emitting = true
if _charge_trail_emitter:
_charge_trail_emitter.emitting = _dust_state == DustState.CHARGE
# Blue energy trail belongs to the roll/dash ability only, not to fast WASD
# running — driven explicitly in the roll loop / _end_roll, not by dust state.
func _on_dp_changed(_key: String, _val: Variant) -> void:
@@ -306,9 +318,11 @@ func _update_locomotion_anim(moving: bool) -> void:
return
_locomotion_moving = moving
if moving:
if _bull_anim.has_animation(_ANIM_DASH):
_bull_anim.speed_scale = 1.0
_bull_anim.play(_ANIM_DASH, 0.25)
if _bull_anim.has_animation(_ANIM_WALK):
_bull_anim.speed_scale = 2.0
_bull_anim.play(_ANIM_WALK, 1)
var anim = _bull_anim.get_animation(_ANIM_WALK)
anim.loop_mode = Animation.LOOP_LINEAR
else:
_play_idle()
@@ -490,6 +504,7 @@ func _tick_roll(delta: float, _steer: Vector3) -> void:
_set_dust_state(DustState.CHARGE)
if _charge_trail_emitter:
_charge_trail_emitter.emitting = true
_charge_trail_emitter.direction = (-_roll_dir + Vector3(0.0, 0.25, 0.0)).normalized()
move_and_slide()
@@ -571,6 +586,8 @@ func _end_roll() -> void:
_legs.set(&"external_rotation", false)
if _roll_spark_emitter:
_roll_spark_emitter.emitting = false
if _charge_trail_emitter:
_charge_trail_emitter.emitting = false
velocity.x *= 0.15
velocity.z *= 0.15
_play_idle()
@@ -1085,6 +1102,9 @@ func take_sword_hit(cause: String = "", hit_pos: Vector3 = Vector3.ZERO) -> void
_huff_player.pitch_scale = randf_range(0.7, 0.9)
_huff_player.play()
if _hp <= 0:
if _bull_anim.current_animation != _ANIM_DEATH:
_bull_anim.speed_scale = 0.8
_bull_anim.play(_ANIM_DEATH)
_dead = true
died.emit(cause)
+16 -9
View File
@@ -13,13 +13,11 @@ config_version=5
config/name="Bullosseum"
config/version="0.2.0"
run/main_scene="res://MainMenu.tscn"
config/features=PackedStringArray("4.7", "Forward Plus")
config/icon="res://icon.svg"
config/run/main_scene="res://MainMenu.tscn"
config/features=PackedStringArray("4.7", "GL Compatibility")
boot_splash/bg_color=Color(0, 0, 0, 1)
boot_splash/image="res://Assets/loading_screen.png"
boot_splash/fullsize=true
boot_splash/use_filter=true
config/icon="uid://dct1d88g015el"
config/run/main_scene="res://MainMenu.tscn"
[autoload]
@@ -28,6 +26,13 @@ Console="*res://console.gd"
Controls="*res://controls_manager.gd"
DebugDraw="*res://debug_draw.gd"
Settings="*res://settings.gd"
Run="*res://levels/run_state.gd"
OrientationGuard="*res://orientation_guard.gd"
[display]
window/size/mode=3
window/handheld/orientation=4
[editor_plugins]
@@ -90,13 +95,13 @@ ability_kick={
}
ability_slam={
"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)
"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":72,"key_label":0,"unicode":104,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null)
]
}
ability_dash={
"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":72,"key_label":0,"unicode":104,"location":0,"echo":false,"script":null)
"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)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":1,"pressure":0.0,"pressed":true,"script":null)
]
}
@@ -117,5 +122,7 @@ pointing/emulate_touch_from_mouse=true
[rendering]
rendering_device/driver.windows="d3d12"
anti_aliasing/quality/use_taa=true
rendering_device/driver.windows="opengl3"
renderer/rendering_method="gl_compatibility"
textures/vram_compression/import_s3tc_bptc=true
textures/vram_compression/import_etc2_astc=true
+128
View File
@@ -0,0 +1,128 @@
extends RefCounted
## Converts Skeleton3D-skinned meshes into NON-skinned mesh pieces parented to
## BoneAttachment3D nodes, so rendering never uses GPU vertex-skinning (transform
## feedback). Required on ANGLE/Vulkan/Mali mobile GPUs (e.g. Mali-G720 in mobile
## Chrome/Brave), where Godot's Compatibility skinning path renders skinned meshes
## invisible while non-skinned meshes draw fine.
##
## Each triangle is assigned wholesale to its dominant bone (highest summed weight),
## so segments stay watertight; joints become rigid (no smooth bending), which suits
## the low-poly look. Call RigidSkin.convert_tree(character_root) once after the scene
## is instanced (bones don't need to be posed yet — pieces are baked in bind space).
static func convert_tree(root: Node) -> int:
var converted := 0
for skel: Skeleton3D in _find(root, "Skeleton3D", []):
for mi: Node in skel.get_children():
if mi is MeshInstance3D and (mi as MeshInstance3D).skin != null \
and (mi as MeshInstance3D).mesh is ArrayMesh:
if _convert(skel, mi as MeshInstance3D):
converted += 1
return converted
static func _find(n: Node, klass: String, acc: Array) -> Array:
if n.is_class(klass):
acc.append(n)
for c: Node in n.get_children():
_find(c, klass, acc)
return acc
static func _convert(skel: Skeleton3D, mi: MeshInstance3D) -> bool:
var mesh := mi.mesh as ArrayMesh
var skin := mi.skin
# bind index -> (bone index, bind pose = mesh-space -> bone-local)
var bind_bone: PackedInt32Array = []
var bind_pose: Array[Transform3D] = []
for b: int in skin.get_bind_count():
var bone := skin.get_bind_bone(b)
if bone < 0:
bone = skel.find_bone(skin.get_bind_name(b))
bind_bone.append(bone)
bind_pose.append(skin.get_bind_pose(b))
# Accumulate SurfaceTool geometry per destination bone.
var st_by_bone: Dictionary = {} # bone index -> SurfaceTool
var mat_by_bone: Dictionary = {} # bone index -> Material (first seen)
for s: int in mesh.get_surface_count():
var arr := mesh.surface_get_arrays(s)
var verts: PackedVector3Array = arr[Mesh.ARRAY_VERTEX]
var norms: PackedVector3Array = arr[Mesh.ARRAY_NORMAL]
var uvs: PackedVector2Array = arr[Mesh.ARRAY_TEX_UV] if arr[Mesh.ARRAY_TEX_UV] != null else PackedVector2Array()
var cols: PackedColorArray = arr[Mesh.ARRAY_COLOR] if arr[Mesh.ARRAY_COLOR] != null else PackedColorArray()
var bones: PackedInt32Array = arr[Mesh.ARRAY_BONES]
var weights: PackedFloat32Array = arr[Mesh.ARRAY_WEIGHTS]
var idx: PackedInt32Array = arr[Mesh.ARRAY_INDEX]
var mat := mesh.surface_get_material(s)
var infl := 8 if (mesh.surface_get_format(s) & Mesh.ARRAY_FLAG_USE_8_BONE_WEIGHTS) else 4
var tri := PackedInt32Array()
if idx != null and idx.size() > 0:
tri = idx
else:
tri.resize(verts.size())
for i: int in verts.size():
tri[i] = i
for t: int in range(0, tri.size(), 3):
var a := tri[t]
var b := tri[t + 1]
var c := tri[t + 2]
var bind := _dominant_bind([a, b, c], bones, weights, infl)
var bone := bind_bone[bind]
var pose := bind_pose[bind]
var st: SurfaceTool = st_by_bone.get(bone)
if st == null:
st = SurfaceTool.new()
st.begin(Mesh.PRIMITIVE_TRIANGLES)
st_by_bone[bone] = st
mat_by_bone[bone] = mat
for v: int in [a, b, c]:
if cols.size() > v:
st.set_color(cols[v])
if uvs.size() > v:
st.set_uv(uvs[v])
if norms.size() > v:
st.set_normal((pose.basis * norms[v]).normalized())
st.add_vertex(pose * verts[v])
if st_by_bone.is_empty():
return false
for bone: int in st_by_bone:
var att := BoneAttachment3D.new()
att.bone_name = skel.get_bone_name(bone)
skel.add_child(att)
var piece := MeshInstance3D.new()
var st: SurfaceTool = st_by_bone[bone]
var m := st.commit()
if mat_by_bone[bone] != null:
m.surface_set_material(0, mat_by_bone[bone])
piece.mesh = m
att.add_child(piece)
# Hide (don't free) the original: keeps the node for any gameplay code that references
# it, and a hidden skinned mesh isn't drawn so it never hits the transform-feedback path.
mi.visible = false
return true
static func _dominant_bind(vs: Array, bones: PackedInt32Array, weights: PackedFloat32Array, infl: int) -> int:
var acc: Dictionary = {}
for v: int in vs:
for k: int in infl:
var w := weights[v * infl + k]
if w <= 0.0:
continue
var bind := bones[v * infl + k]
acc[bind] = float(acc.get(bind, 0.0)) + w
var best := 0
var best_w := -1.0
for bind: int in acc:
if acc[bind] > best_w:
best_w = acc[bind]
best = bind
return best
+1
View File
@@ -0,0 +1 @@
uid://dymd8vcfmtjts
+5 -1
View File
@@ -8,7 +8,7 @@ SKIP_GAMEPLAY=0
for arg in "$@"; do [[ "$arg" == "--no-gameplay" ]] && SKIP_GAMEPLAY=1; done
echo "=== gdlint ==="
gdlint *.gd tests/*.gd
gdlint *.gd levels/*.gd tests/*.gd
echo ""
echo "=== Logic tests ==="
@@ -18,6 +18,10 @@ echo ""
echo "=== Console focus tests ==="
"$GODOT" --headless --script tests/console_focus_test.gd
echo ""
echo "=== Level switch tests (no cross-level geometry/collider leaks) ==="
"$GODOT" --headless --script tests/level_switch_test.gd
echo ""
echo "=== Performance tests (frame-budget regression guard) ==="
"$GODOT" --headless --script tests/performance_test.gd
+57 -413
View File
@@ -1,18 +1,10 @@
[gd_scene format=3 uid="uid://b7afbx36ltb3f"]
[ext_resource type="PackedScene" uid="uid://crtm0xtiql3r8" path="res://Player.tscn" id="1_ulcgi"]
[ext_resource type="PackedScene" uid="uid://dio67r8ambe7h" path="res://Assets/arena_placeholder_v01.glb" id="2_nxogm"]
[ext_resource type="PackedScene" uid="uid://cl54dt38yj2x" path="res://Assets/Arena.glb" id="3_fy5k1"]
[ext_resource type="Script" uid="uid://dou5ar6tkmng1" path="res://matador_spawn.gd" id="3_spawn"]
[ext_resource type="Shader" uid="uid://d3xyyy5bh0ma" path="res://ps1_filter.gdshader" id="4_ps1shader"]
[ext_resource type="PackedScene" uid="uid://cmxqocsdbgufr" path="res://Animations/mees_plaksutab.glb" id="5_m7jmp"]
[ext_resource type="PackedScene" uid="uid://1y07gn65ktsi" path="res://Animations/ANIM_publik_mees.glb" id="7_xlvrw"]
[ext_resource type="Script" uid="uid://dr6phggarm73e" path="res://Animations/anim_publik_mees.gd" id="8_73fnb"]
[ext_resource type="Script" uid="uid://di0jafakftp3n" path="res://publikum_controller.gd" id="9_pubctrl"]
[ext_resource type="PackedScene" uid="uid://dxe72ig8gfbcg" path="res://Assets/arena model2026.glb" id="10_5juve"]
[ext_resource type="Script" uid="uid://butd6b3tdwxrv" path="res://hud.gd" id="10_hud"]
[ext_resource type="Script" uid="uid://cj0ytlkuavmf4" path="res://crowd_billboards.gd" id="11_crowd"]
[ext_resource type="Script" uid="uid://ce5n4qu88mhyx" path="res://ps1_filter.gd" id="12_ps1ctl"]
[ext_resource type="Script" uid="uid://ptsfs3wq5bje" path="res://levels/game_shell.gd" id="13_shell"]
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_73fnb"]
dof_blur_far_enabled = true
@@ -23,8 +15,6 @@ dof_blur_near_distance = 8192.0
dof_blur_near_transition = 8192.0
dof_blur_amount = 1.0
[sub_resource type="BoxShape3D" id="BoxShape3D_ulcgi"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ps1"]
shader = ExtResource("4_ps1shader")
shader_parameter/pixel_scale = 4.0
@@ -34,11 +24,10 @@ shader_parameter/scanline_strength = 0.2
shader_parameter/roll_speed = 3.0
shader_parameter/roll_strength = 1.0
[sub_resource type="Environment" id="Environment_73fnb"]
[node name="scene" type="Node3D" unique_id=118294681]
script = ExtResource("13_shell")
[node name="scene" type="Node3D" unique_id=22320312]
[node name="Player" parent="." unique_id=165510044 instance=ExtResource("1_ulcgi")]
[node name="Player" parent="." unique_id=332720469 instance=ExtResource("1_ulcgi")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.2416196, 5.1711025, -4.841382)
[node name="Camera3D" parent="Player" index="3" unique_id=1120161087]
@@ -47,38 +36,63 @@ fov = 50.0
near = 2.636
far = 0.01
[node name="Node3D" type="Node3D" parent="." unique_id=1081100876]
[node name="Skeleton3D" parent="Player/bull/Armature" parent_id_path=PackedInt32Array(332720469, 1386495166, 1883464126) index="0" unique_id=72207798]
bones/0/position = Vector3(0, 0, 0.0074015963)
bones/0/rotation = Quaternion(-0.36922705, 0.6030517, -0.6030517, -0.36922705)
bones/0/scale = Vector3(1, 1, 1)
bones/1/position = Vector3(0.003526625, -0.0043296535, 0.004082799)
bones/1/rotation = Quaternion(-0.00038647576, 0.06909673, 0.9868542, -0.14609681)
bones/1/scale = Vector3(1.0000021, 1.0000001, 1.0000006)
bones/2/position = Vector3(-5.853537e-11, 0.002669535, -1.489375e-10)
bones/2/rotation = Quaternion(-0.06929122, 3.2415448e-07, -0.11267061, 0.99121344)
bones/2/scale = Vector3(1, 1.0000001, 0.9999999)
bones/4/position = Vector3(0.004535823, -0.0021376952, -0.0042386237)
bones/4/rotation = Quaternion(-0.24948508, 0.19590344, 0.9416978, -0.11217982)
bones/4/scale = Vector3(0.99999994, 0.99999994, 1.0000002)
bones/5/position = Vector3(1.264555e-10, 0.0028599252, -2.4303243e-10)
bones/5/rotation = Quaternion(-0.58943665, -0.36607245, -0.2256448, 0.683842)
bones/6/position = Vector3(-7.092306e-11, 0.003274492, 4.6413304e-10)
bones/6/rotation = Quaternion(0.52910197, 0.15997829, 0.12024502, 0.82462066)
bones/6/scale = Vector3(1, 1.0000001, 1.0000001)
bones/8/position = Vector3(2.259811e-19, 0.0010177285, -0.008495503)
bones/8/rotation = Quaternion(-0.70710677, 0, 0, 0.70710677)
bones/8/scale = Vector3(1, 1, 1)
bones/9/position = Vector3(4.814825e-35, 0.0017711426, 0)
bones/10/position = Vector3(4.814825e-35, 0.0018082206, 0)
bones/11/position = Vector3(0, 0.0019911951, 0)
bones/11/scale = Vector3(1, 1, 1)
bones/12/position = Vector3(0, 0.002023485, 0)
bones/12/scale = Vector3(1, 1, 1)
bones/13/position = Vector3(0, 0.0016682985, 0)
bones/13/scale = Vector3(1, 1, 1)
bones/14/position = Vector3(0, 0.0014960878, 0)
bones/14/scale = Vector3(1, 1, 1)
bones/15/position = Vector3(0, 0.0010996431, 0)
bones/17/position = Vector3(0, 0.000937381, 0.0075526168)
bones/17/rotation = Quaternion(-5.3385083e-08, 0.70710677, 0.70710677, -5.3385083e-08)
bones/19/position = Vector3(-0.003526625, -0.0043296535, 0.004082799)
bones/19/rotation = Quaternion(0.00038647576, 0.06909673, 0.9868542, 0.14609681)
bones/19/scale = Vector3(1.0000021, 1.0000001, 1.0000006)
bones/20/position = Vector3(5.853537e-11, 0.002669535, -1.489375e-10)
bones/20/rotation = Quaternion(-0.06929122, -3.2415448e-07, 0.11267061, 0.99121344)
bones/20/scale = Vector3(1, 1.0000001, 0.9999999)
bones/22/position = Vector3(-0.004535823, -0.0021376952, -0.0042386237)
bones/22/rotation = Quaternion(0.24948508, 0.19590344, 0.9416978, 0.11217982)
bones/22/scale = Vector3(0.99999994, 0.99999994, 1.0000002)
bones/23/position = Vector3(-1.264555e-10, 0.0028599252, -2.4303243e-10)
bones/23/rotation = Quaternion(-0.58943665, 0.36607245, 0.2256448, 0.683842)
bones/23/scale = Vector3(1, 1, 1)
bones/24/position = Vector3(7.092306e-11, 0.003274492, 4.6413304e-10)
bones/24/rotation = Quaternion(0.52910197, -0.15997829, -0.12024502, 0.82462066)
bones/24/scale = Vector3(1, 1.0000001, 1.0000001)
[node name="StaticBody3D" type="StaticBody3D" parent="Node3D" unique_id=2072095624]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Node3D/StaticBody3D" unique_id=1444198204]
transform = Transform3D(30, 0, 0, 0, 1, 0, 0, 0, 30, 0, -0.5, 0)
shape = SubResource("BoxShape3D_ulcgi")
[node name="arena_placeholder_v01" parent="Node3D" unique_id=1341659233 instance=ExtResource("2_nxogm")]
[node name="Arena_draft" parent="Node3D/arena_placeholder_v01" index="0" unique_id=603097973]
visible = false
[node name="Wall" parent="Node3D/arena_placeholder_v01" index="1" unique_id=171701243]
visible = false
[node name="Arena2" parent="Node3D/arena_placeholder_v01" unique_id=524718167 instance=ExtResource("3_fy5k1")]
[node name="arena model2026" parent="Node3D/arena_placeholder_v01" unique_id=179544183 instance=ExtResource("10_5juve")]
transform = Transform3D(0.99999994, 0, 0, 0, 0.99999994, 0, 0, 0, 0.99999994, -0.901, -0.6, 0)
visible = false
[node name="MatadorSpawner" type="Node3D" parent="." unique_id=-1293967295]
script = ExtResource("3_spawn")
[node name="HUD" type="CanvasLayer" parent="." unique_id=1100000001]
[node name="HUD" type="CanvasLayer" parent="." unique_id=475750379]
script = ExtResource("10_hud")
[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1032421313]
[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=998765394]
layer = 10
[node name="PS1Filter" type="ColorRect" parent="CanvasLayer" unique_id=1449116873]
[node name="PS1Filter" type="ColorRect" parent="CanvasLayer" unique_id=1660776144]
material = SubResource("ShaderMaterial_ps1")
anchors_preset = 15
anchor_right = 1.0
@@ -87,377 +101,7 @@ grow_horizontal = 2
grow_vertical = 2
script = ExtResource("12_ps1ctl")
[node name="Lights" type="Node3D" parent="." unique_id=737767662]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Lights" unique_id=818712731]
transform = Transform3D(0.01535992, 0.56825536, -0.82270896, 0.16280846, 0.8104039, 0.56279576, 0.9865382, -0.14258848, -0.08006904, -4.08134, 9.197985, 0.97087634)
light_energy = 0.4
light_indirect_energy = 0.767
shadow_blur = 0.47
[node name="SpotLight3D2" type="SpotLight3D" parent="Lights" unique_id=918477294]
transform = Transform3D(0.904133, 0.30962402, -0.2944087, 0.3084627, 0.0037425472, 0.9512291, 0.2956252, -0.95085174, -0.0921237, -3.629381, 10.86347, -2.0124264)
light_energy = 16.0
light_indirect_energy = 26.095
distance_fade_enabled = true
spot_range = 32.90586
spot_angle = 73.93
[node name="SpotLight3D" type="SpotLight3D" parent="Lights" unique_id=422808558]
transform = Transform3D(0.9763736, -9.445564e-09, 0.21608931, -0.20963383, 0.24260214, 0.9472053, -0.052423734, -0.9701259, 0.23687032, 4.0400305, 13.463301, 3.9410677)
visible = false
light_energy = 13.695
shadow_enabled = true
spot_range = 32.90586
[node name="SUN_DirectionalLight3D2" type="DirectionalLight3D" parent="Lights" unique_id=1706919950]
transform = Transform3D(0.45811793, 0.34843865, -0.81775206, 0.5316611, 0.62986195, 0.56622505, 0.7123655, -0.69416475, 0.10329977, 0, 8.980043, 0)
light_energy = 1.199
shadow_enabled = true
shadow_blur = 10.0
[node name="PublikNode" type="Node3D" parent="." unique_id=1020007445]
visible = false
[node name="publikum2" type="Node3D" parent="PublikNode" unique_id=813507078]
transform = Transform3D(-0.91522944, 0, -0.4029331, 0, 1, 0, 0.4029331, 0, -0.91522944, 4.195425, 3.6553268, 13.885913)
visible = false
script = ExtResource("9_pubctrl")
[node name="mees_plaksutab" parent="PublikNode/publikum2" unique_id=1052467743 instance=ExtResource("5_m7jmp")]
[node name="mees_plaksutab2" parent="PublikNode/publikum2" unique_id=1015461330 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.8139224, 0, -0.33299255)
[node name="mees_plaksutab3" parent="PublikNode/publikum2" unique_id=1089134459 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5662975, 0, 0.3316717)
[node name="mees_plaksutab4" parent="PublikNode/publikum2" unique_id=322028795 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -8.003071, 0, 1.5986013)
[node name="mees_plaksutab5" parent="PublikNode/publikum2" unique_id=482889095 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -7.1850557, 0.8316374, 0.36604595)
[node name="mees_plaksutab6" parent="PublikNode/publikum2" unique_id=944445851 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.97025216, 0, 0.24209678, 0, 1, 0, -0.24209678, 0, 0.97025216, -4.039103, 0.8316374, -0.8892679)
[node name="publikum4" type="Node3D" parent="PublikNode" unique_id=68365083]
transform = Transform3D(-0.629974, 0, -0.77661633, 0, 1, 0, 0.77661633, 0, -0.629974, 9.842437, 3.6553268, 10.401334)
visible = false
script = ExtResource("9_pubctrl")
[node name="mees_plaksutab" parent="PublikNode/publikum4" unique_id=222379180 instance=ExtResource("5_m7jmp")]
[node name="mees_plaksutab2" parent="PublikNode/publikum4" unique_id=1871765797 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.8139224, 0, -0.33299255)
[node name="mees_plaksutab3" parent="PublikNode/publikum4" unique_id=10437017 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5662975, 0, 0.3316717)
[node name="mees_plaksutab4" parent="PublikNode/publikum4" unique_id=901414927 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -8.003071, 0, 1.5986013)
[node name="mees_plaksutab5" parent="PublikNode/publikum4" unique_id=2077358822 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -7.1850557, 0.8316374, 0.36604595)
[node name="mees_plaksutab6" parent="PublikNode/publikum4" unique_id=1131238522 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.97025216, 0, 0.24209678, 0, 1, 0, -0.24209678, 0, 0.97025216, -4.039103, 0.8316374, -0.8892679)
[node name="publikum5" type="Node3D" parent="PublikNode" unique_id=1254884314]
transform = Transform3D(-0.39064395, 0, 0.920542, 0, 1, 0, -0.920542, 0, -0.39064395, -14.538336, 3.6553268, 3.9378712)
script = ExtResource("9_pubctrl")
[node name="mees_plaksutab" parent="PublikNode/publikum5" unique_id=1914156014 instance=ExtResource("5_m7jmp")]
[node name="mees_plaksutab2" parent="PublikNode/publikum5" unique_id=602140062 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.8139224, 0, -0.33299255)
[node name="mees_plaksutab3" parent="PublikNode/publikum5" unique_id=224404749 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5662975, 0, 0.3316717)
[node name="mees_plaksutab4" parent="PublikNode/publikum5" unique_id=958300982 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -8.003071, 0, 1.5986013)
[node name="mees_plaksutab5" parent="PublikNode/publikum5" unique_id=860025476 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -7.1850557, 0.8316374, 0.36604595)
[node name="mees_plaksutab6" parent="PublikNode/publikum5" unique_id=1052988416 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.97025216, 0, 0.24209678, 0, 1, 0, -0.24209678, 0, 0.97025216, -4.039103, 0.8316374, -0.8892679)
[node name="publikum6" type="Node3D" parent="PublikNode" unique_id=709827517]
transform = Transform3D(-0.7681126, 0, 0.64031476, 0, 1, 0, -0.64031476, 0, -0.7681126, -11.103292, 3.6553288, 9.335619)
script = ExtResource("9_pubctrl")
[node name="mees_plaksutab" parent="PublikNode/publikum6" unique_id=1007939702 instance=ExtResource("5_m7jmp")]
[node name="mees_plaksutab2" parent="PublikNode/publikum6" unique_id=860884329 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.8139224, 0, -0.33299255)
[node name="mees_plaksutab3" parent="PublikNode/publikum6" unique_id=1928974579 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5662975, 0, 0.3316717)
[node name="mees_plaksutab4" parent="PublikNode/publikum6" unique_id=547889733 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -8.003071, 0, 1.5986013)
[node name="mees_plaksutab5" parent="PublikNode/publikum6" unique_id=1501877017 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -7.1850557, 0.8316374, 0.36604595)
[node name="mees_plaksutab6" parent="PublikNode/publikum6" unique_id=1951764566 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.97025216, 0, 0.24209678, 0, 1, 0, -0.24209678, 0, 0.97025216, -4.039103, 0.8316374, -0.8892679)
[node name="publikum7" type="Node3D" parent="PublikNode" unique_id=1483978907]
transform = Transform3D(0.55061686, 0, -0.8347584, 0, 1, 0, 0.8347584, 0, 0.55061686, 13.163043, 3.4379854, -5.268345)
script = ExtResource("9_pubctrl")
[node name="mees_plaksutab" parent="PublikNode/publikum7" unique_id=788603784 instance=ExtResource("5_m7jmp")]
[node name="mees_plaksutab2" parent="PublikNode/publikum7" unique_id=1537286096 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.8139224, 0, -0.33299255)
[node name="mees_plaksutab3" parent="PublikNode/publikum7" unique_id=1957279061 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5662975, 0, 0.3316717)
[node name="mees_plaksutab4" parent="PublikNode/publikum7" unique_id=1379894897 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -8.003071, 0, 1.5986013)
[node name="mees_plaksutab5" parent="PublikNode/publikum7" unique_id=1920281402 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -7.1850557, 0.8316374, 0.36604595)
[node name="mees_plaksutab6" parent="PublikNode/publikum7" unique_id=811906038 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.97025216, 0, 0.24209678, 0, 1, 0, -0.24209678, 0, 0.97025216, -4.039103, 0.8316374, -0.8892679)
[node name="publikum8" type="Node3D" parent="PublikNode" unique_id=1073953916]
transform = Transform3D(0.85247177, 0, -0.5227735, 0, 1, 0, 0.5227735, 0, 0.85247177, 11.217102, 4.568224, -10.151715)
script = ExtResource("9_pubctrl")
[node name="mees_plaksutab" parent="PublikNode/publikum8" unique_id=641607406 instance=ExtResource("5_m7jmp")]
[node name="mees_plaksutab2" parent="PublikNode/publikum8" unique_id=740439664 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.8139224, 0, -0.33299255)
[node name="mees_plaksutab3" parent="PublikNode/publikum8" unique_id=1896496635 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5662975, 0, 0.3316717)
[node name="mees_plaksutab4" parent="PublikNode/publikum8" unique_id=1787601370 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -8.003071, 0, 1.5986013)
[node name="mees_plaksutab5" parent="PublikNode/publikum8" unique_id=1153730967 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -7.1850557, 0.8316374, 0.36604595)
[node name="mees_plaksutab6" parent="PublikNode/publikum8" unique_id=1023874478 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.97025216, 0, 0.24209678, 0, 1, 0, -0.24209678, 0, 0.97025216, -4.039103, 0.8316374, -0.8892679)
[node name="publikum3" type="Node3D" parent="PublikNode" unique_id=71842083]
transform = Transform3D(0.8698311, 0, 0.49334967, 0, 1, 0, -0.49334967, 0, 0.8698311, -4.8910522, 4.627474, -14.224113)
script = ExtResource("9_pubctrl")
[node name="mees_plaksutab" parent="PublikNode/publikum3" unique_id=1585155222 instance=ExtResource("5_m7jmp")]
[node name="mees_plaksutab2" parent="PublikNode/publikum3" unique_id=1301960990 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.8139224, 0, -0.33299255)
[node name="mees_plaksutab3" parent="PublikNode/publikum3" unique_id=1481094020 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5662975, 0, 0.3316717)
[node name="mees_plaksutab4" parent="PublikNode/publikum3" unique_id=1958614289 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -8.003071, 0, 1.5986013)
[node name="mees_plaksutab5" parent="PublikNode/publikum3" unique_id=318927325 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -7.1850557, 0.8316374, 0.36604595)
[node name="mees_plaksutab6" parent="PublikNode/publikum3" unique_id=492002897 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.97025216, 0, 0.24209678, 0, 1, 0, -0.24209678, 0, 0.97025216, -4.039103, 0.8316374, -0.8892679)
[node name="publikum9" type="Node3D" parent="PublikNode" unique_id=1844757155]
transform = Transform3D(0.9760592, 0, 0.21750516, 0, 1, 0, -0.21750516, 0, 0.9760592, -2.1318102, 3.6553268, -13.557504)
script = ExtResource("9_pubctrl")
[node name="mees_plaksutab" parent="PublikNode/publikum9" unique_id=896469763 instance=ExtResource("5_m7jmp")]
[node name="mees_plaksutab2" parent="PublikNode/publikum9" unique_id=1412552760 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.8139224, 0, -0.33299255)
[node name="mees_plaksutab3" parent="PublikNode/publikum9" unique_id=59611810 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5662975, 0, 0.3316717)
[node name="mees_plaksutab4" parent="PublikNode/publikum9" unique_id=1161683450 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -8.003071, 0, 1.5986013)
[node name="mees_plaksutab5" parent="PublikNode/publikum9" unique_id=1706050589 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -7.1850557, 0.8316374, 0.36604595)
[node name="mees_plaksutab6" parent="PublikNode/publikum9" unique_id=1929239115 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.97025216, 0, 0.24209678, 0, 1, 0, -0.24209678, 0, 0.97025216, -4.039103, 0.8316374, -0.8892679)
[node name="publikum11" type="Node3D" parent="PublikNode" unique_id=727404993]
transform = Transform3D(-0.95107377, 0, -0.30896416, 0, 1, 0, 0.30896416, 0, -0.95107377, 2.4321594, 3.6553268, 14.119543)
visible = false
script = ExtResource("9_pubctrl")
[node name="mees_plaksutab" parent="PublikNode/publikum11" unique_id=36716174 instance=ExtResource("5_m7jmp")]
[node name="mees_plaksutab2" parent="PublikNode/publikum11" unique_id=2117684869 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.8139224, 0, -0.33299255)
[node name="mees_plaksutab3" parent="PublikNode/publikum11" unique_id=684167492 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5662975, 0, 0.3316717)
[node name="mees_plaksutab4" parent="PublikNode/publikum11" unique_id=678520535 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -8.003071, 0, 1.5986013)
[node name="mees_plaksutab5" parent="PublikNode/publikum11" unique_id=1746700688 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -7.1850557, 0.8316374, 0.36604595)
[node name="mees_plaksutab6" parent="PublikNode/publikum11" unique_id=462492236 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.97025216, 0, 0.24209678, 0, 1, 0, -0.24209678, 0, 0.97025216, -4.039103, 0.8316374, -0.8892679)
[node name="publikum13" type="Node3D" parent="PublikNode" unique_id=1816403209]
transform = Transform3D(-0.2962035, 0, 0.95512486, 0, 1, 0, -0.95512486, 0, -0.2962035, -14.037817, 3.6553268, 2.0647745)
script = ExtResource("9_pubctrl")
[node name="mees_plaksutab" parent="PublikNode/publikum13" unique_id=1252057421 instance=ExtResource("5_m7jmp")]
[node name="mees_plaksutab2" parent="PublikNode/publikum13" unique_id=1096867731 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.1134007, 0, 0.6326933)
[node name="mees_plaksutab3" parent="PublikNode/publikum13" unique_id=1130631283 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5662975, 0, 0.3316717)
[node name="mees_plaksutab4" parent="PublikNode/publikum13" unique_id=2008334523 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -8.003071, 0, 1.5986013)
[node name="mees_plaksutab5" parent="PublikNode/publikum13" unique_id=1185367656 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -7.1850557, 0.8316374, 0.36604595)
[node name="mees_plaksutab6" parent="PublikNode/publikum13" unique_id=649140591 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.97025216, 0, 0.24209678, 0, 1, 0, -0.24209678, 0, 0.97025216, -4.039103, 0.8316374, -0.8892679)
[node name="publikum15" type="Node3D" parent="PublikNode" unique_id=926602558]
transform = Transform3D(0.43092924, 0, -0.90238583, 0, 1, 0, 0.90238583, 0, 0.43092924, 14.766085, 4.568224, -2.378694)
script = ExtResource("9_pubctrl")
[node name="mees_plaksutab" parent="PublikNode/publikum15" unique_id=2043094085 instance=ExtResource("5_m7jmp")]
[node name="mees_plaksutab2" parent="PublikNode/publikum15" unique_id=1927429095 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.8139224, 0, -0.33299255)
[node name="mees_plaksutab3" parent="PublikNode/publikum15" unique_id=1660696957 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5662975, 0, 0.3316717)
[node name="mees_plaksutab4" parent="PublikNode/publikum15" unique_id=1684596154 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -8.003071, 0, 1.5986013)
[node name="mees_plaksutab5" parent="PublikNode/publikum15" unique_id=1401913487 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -7.1850557, 0.8316374, 0.36604595)
[node name="mees_plaksutab6" parent="PublikNode/publikum15" unique_id=1893327164 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.97025216, 0, 0.24209678, 0, 1, 0, -0.24209678, 0, 0.97025216, -4.039103, 0.8316374, -0.8892679)
[node name="ANIM_publik_mees" parent="PublikNode" unique_id=413106028 instance=ExtResource("7_xlvrw")]
transform = Transform3D(-0.9976194, 0, 0.0689602, 0, 1, 0, -0.0689602, 0, -0.9976194, -2.9310942, 4.1751385, 14.861324)
script = ExtResource("8_73fnb")
[node name="publikum" type="Node3D" parent="PublikNode" unique_id=1311444475]
transform = Transform3D(0.70069104, 0, 0.7134648, 0, 1, 0, -0.7134648, 0, 0.70069104, -9.04294, 3.6553268, -10.339719)
script = ExtResource("9_pubctrl")
[node name="mees_plaksutab" parent="PublikNode/publikum" unique_id=1787142704 instance=ExtResource("5_m7jmp")]
[node name="mees_plaksutab2" parent="PublikNode/publikum" unique_id=330098781 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.8139224, 0, -0.33299255)
[node name="mees_plaksutab3" parent="PublikNode/publikum" unique_id=1406686735 instance=ExtResource("5_m7jmp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5662975, 0, 0.3316717)
[node name="mees_plaksutab4" parent="PublikNode/publikum" unique_id=132494522 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -8.003071, 0, 1.5986013)
[node name="mees_plaksutab5" parent="PublikNode/publikum" unique_id=2101925215 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.89589787, 0, 0.44426048, 0, 1, 0, -0.44426048, 0, 0.89589787, -7.1850557, 0.8316374, 0.36604595)
[node name="mees_plaksutab6" parent="PublikNode/publikum" unique_id=403179328 instance=ExtResource("5_m7jmp")]
transform = Transform3D(0.97025216, 0, 0.24209678, 0, 1, 0, -0.24209678, 0, 0.97025216, -4.039103, 0.8316374, -0.8892679)
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=755853425]
environment = SubResource("Environment_73fnb")
[node name="CrowdBillboards" type="MultiMeshInstance3D" parent="." unique_id=549548313]
visible = false
script = ExtResource("11_crowd")
[node name="LevelRoot" type="Node3D" parent="." unique_id=5023050]
[editable path="Player"]
[editable path="Player/bull"]
[editable path="Node3D/arena_placeholder_v01"]
[editable path="PublikNode/publikum2/mees_plaksutab"]
[editable path="PublikNode/publikum2/mees_plaksutab2"]
[editable path="PublikNode/publikum2/mees_plaksutab3"]
[editable path="PublikNode/publikum2/mees_plaksutab4"]
[editable path="PublikNode/publikum2/mees_plaksutab5"]
[editable path="PublikNode/publikum2/mees_plaksutab6"]
[editable path="PublikNode/publikum4/mees_plaksutab"]
[editable path="PublikNode/publikum4/mees_plaksutab2"]
[editable path="PublikNode/publikum4/mees_plaksutab3"]
[editable path="PublikNode/publikum4/mees_plaksutab4"]
[editable path="PublikNode/publikum4/mees_plaksutab5"]
[editable path="PublikNode/publikum4/mees_plaksutab6"]
[editable path="PublikNode/publikum5/mees_plaksutab"]
[editable path="PublikNode/publikum5/mees_plaksutab2"]
[editable path="PublikNode/publikum5/mees_plaksutab3"]
[editable path="PublikNode/publikum5/mees_plaksutab4"]
[editable path="PublikNode/publikum5/mees_plaksutab5"]
[editable path="PublikNode/publikum5/mees_plaksutab6"]
[editable path="PublikNode/publikum6/mees_plaksutab"]
[editable path="PublikNode/publikum6/mees_plaksutab2"]
[editable path="PublikNode/publikum6/mees_plaksutab3"]
[editable path="PublikNode/publikum6/mees_plaksutab4"]
[editable path="PublikNode/publikum6/mees_plaksutab5"]
[editable path="PublikNode/publikum6/mees_plaksutab6"]
[editable path="PublikNode/publikum7/mees_plaksutab"]
[editable path="PublikNode/publikum7/mees_plaksutab2"]
[editable path="PublikNode/publikum7/mees_plaksutab3"]
[editable path="PublikNode/publikum7/mees_plaksutab4"]
[editable path="PublikNode/publikum7/mees_plaksutab5"]
[editable path="PublikNode/publikum7/mees_plaksutab6"]
[editable path="PublikNode/publikum8/mees_plaksutab"]
[editable path="PublikNode/publikum8/mees_plaksutab2"]
[editable path="PublikNode/publikum8/mees_plaksutab3"]
[editable path="PublikNode/publikum8/mees_plaksutab4"]
[editable path="PublikNode/publikum8/mees_plaksutab5"]
[editable path="PublikNode/publikum8/mees_plaksutab6"]
[editable path="PublikNode/publikum3/mees_plaksutab"]
[editable path="PublikNode/publikum3/mees_plaksutab2"]
[editable path="PublikNode/publikum3/mees_plaksutab3"]
[editable path="PublikNode/publikum3/mees_plaksutab4"]
[editable path="PublikNode/publikum3/mees_plaksutab5"]
[editable path="PublikNode/publikum3/mees_plaksutab6"]
[editable path="PublikNode/publikum9/mees_plaksutab"]
[editable path="PublikNode/publikum9/mees_plaksutab2"]
[editable path="PublikNode/publikum9/mees_plaksutab3"]
[editable path="PublikNode/publikum9/mees_plaksutab4"]
[editable path="PublikNode/publikum9/mees_plaksutab5"]
[editable path="PublikNode/publikum9/mees_plaksutab6"]
[editable path="PublikNode/publikum11/mees_plaksutab"]
[editable path="PublikNode/publikum11/mees_plaksutab2"]
[editable path="PublikNode/publikum11/mees_plaksutab3"]
[editable path="PublikNode/publikum11/mees_plaksutab4"]
[editable path="PublikNode/publikum11/mees_plaksutab5"]
[editable path="PublikNode/publikum11/mees_plaksutab6"]
[editable path="PublikNode/publikum13/mees_plaksutab"]
[editable path="PublikNode/publikum13/mees_plaksutab2"]
[editable path="PublikNode/publikum13/mees_plaksutab3"]
[editable path="PublikNode/publikum13/mees_plaksutab4"]
[editable path="PublikNode/publikum13/mees_plaksutab5"]
[editable path="PublikNode/publikum13/mees_plaksutab6"]
[editable path="PublikNode/publikum15/mees_plaksutab"]
[editable path="PublikNode/publikum15/mees_plaksutab2"]
[editable path="PublikNode/publikum15/mees_plaksutab3"]
[editable path="PublikNode/publikum15/mees_plaksutab4"]
[editable path="PublikNode/publikum15/mees_plaksutab5"]
[editable path="PublikNode/publikum15/mees_plaksutab6"]
[editable path="PublikNode/ANIM_publik_mees"]
[editable path="PublikNode/publikum/mees_plaksutab"]
[editable path="PublikNode/publikum/mees_plaksutab2"]
[editable path="PublikNode/publikum/mees_plaksutab3"]
[editable path="PublikNode/publikum/mees_plaksutab4"]
[editable path="PublikNode/publikum/mees_plaksutab5"]
[editable path="PublikNode/publikum/mees_plaksutab6"]
+72 -4
View File
@@ -13,11 +13,39 @@ var screen_shake: bool = true
## Gore toggle — when off, no blood spawns (impact spurt + ongoing spear-wound bleed).
var gore: bool = true
## Audio volumes stored as linear 01. Applied to AudioServer buses on load/change.
var volume_master: float = 1.0
var volume_ambient: float = 1.0
var volume_effects: float = 1.0
var mute_all: bool = false
func _ready() -> void:
_ensure_buses()
load_saved()
## Ensure Ambient and Effects buses exist as children of Master.
func _ensure_buses() -> void:
for bus_name: String in ["Ambient", "Effects"]:
if AudioServer.get_bus_index(bus_name) == -1:
AudioServer.add_bus()
var idx := AudioServer.bus_count - 1
AudioServer.set_bus_name(idx, bus_name)
AudioServer.set_bus_send(idx, &"Master")
func _apply_audio() -> void:
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), _vol_db(volume_master))
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Ambient"), _vol_db(volume_ambient))
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Effects"), _vol_db(volume_effects))
AudioServer.set_bus_mute(AudioServer.get_bus_index("Master"), mute_all)
func _vol_db(linear: float) -> float:
return linear_to_db(maxf(linear, 0.0001))
func set_screen_shake(value: bool) -> void:
if screen_shake == value:
return
@@ -34,16 +62,56 @@ func set_gore(value: bool) -> void:
save()
func set_volume_master(value: float) -> void:
volume_master = clampf(value, 0.0, 1.0)
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), _vol_db(volume_master))
changed.emit("volume_master", volume_master)
save()
func set_volume_ambient(value: float) -> void:
volume_ambient = clampf(value, 0.0, 1.0)
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Ambient"), _vol_db(volume_ambient))
changed.emit("volume_ambient", volume_ambient)
save()
func set_volume_effects(value: float) -> void:
volume_effects = clampf(value, 0.0, 1.0)
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Effects"), _vol_db(volume_effects))
changed.emit("volume_effects", volume_effects)
save()
func set_mute_all(value: bool) -> void:
if mute_all == value:
return
mute_all = value
AudioServer.set_bus_mute(AudioServer.get_bus_index("Master"), mute_all)
changed.emit("mute_all", value)
save()
func save() -> void:
var cfg := ConfigFile.new()
cfg.set_value(SECTION, "screen_shake", screen_shake)
cfg.set_value(SECTION, "gore", gore)
cfg.set_value(SECTION, "screen_shake", screen_shake)
cfg.set_value(SECTION, "gore", gore)
cfg.set_value(SECTION, "volume_master", volume_master)
cfg.set_value(SECTION, "volume_ambient", volume_ambient)
cfg.set_value(SECTION, "volume_effects", volume_effects)
cfg.set_value(SECTION, "mute_all", mute_all)
cfg.save(SAVE_PATH)
func load_saved() -> void:
var cfg := ConfigFile.new()
if cfg.load(SAVE_PATH) != OK:
_apply_audio()
return
screen_shake = cfg.get_value(SECTION, "screen_shake", true) as bool
gore = cfg.get_value(SECTION, "gore", true) as bool
screen_shake = cfg.get_value(SECTION, "screen_shake", true) as bool
gore = cfg.get_value(SECTION, "gore", true) as bool
volume_master = cfg.get_value(SECTION, "volume_master", 1.0) as float
volume_ambient = cfg.get_value(SECTION, "volume_ambient", 1.0) as float
volume_effects = cfg.get_value(SECTION, "volume_effects", 1.0) as float
mute_all = cfg.get_value(SECTION, "mute_all", false) as bool
_apply_audio()
+29 -5
View File
@@ -14,7 +14,12 @@ const _DESPAWN_SEC: float = 8.0
const _STUCK_GROUP: StringName = &"stuck_spear"
# Shaft geometry in spear.glb local space: tip at +Z, butt behind the origin.
const _TIP_Z: float = 1.915
const _EMBED_DEPTH: float = 0.45 # how far past the surface the tip buries
const _EMBED_DEPTH: float = 0.72 # how far past the surface the tip buries
# Bone the bull's spears ride on. The collision spheres sit outside the hide, so a
# spear stuck to the body root reads as floating; anchoring to COG also lets it bob
# and rotate with the animated body instead of only the character root.
const _COG_BONE: String = "COG"
const _ANCHOR_NAME: String = "SpearAnchor"
var _mesh: Node3D = null
var _stopped: bool = false
@@ -53,10 +58,12 @@ static func shed_all(bull: Node) -> void:
if scene == null:
scene = bull
var center: Vector3 = (bull as Node3D).global_position
for child in bull.get_children():
if not child.is_in_group(_STUCK_GROUP):
# Stuck spears now live under a BoneAttachment3D deep in the skeleton, so walk the
# whole subtree by group rather than only the bull's direct children.
for node in bull.get_tree().get_nodes_in_group(_STUCK_GROUP):
if not (bull as Node).is_ancestor_of(node):
continue
var mesh := child as Node3D
var mesh := node as Node3D
var gx := mesh.global_transform
var rb := RigidBody3D.new()
rb.collision_layer = 0
@@ -195,7 +202,7 @@ func _embed(other: Object, contact: Vector3, flight: Vector3) -> void:
if bull != null and bull.is_in_group(&"player"):
bull.call(&"take_sword_hit", "thrown", contact)
if is_instance_valid(_mesh) and is_instance_valid(bull):
_mesh.reparent(bull, false)
_mesh.reparent(_spear_anchor(bull), false)
_mesh.global_transform = pose
_mesh.add_to_group(_STUCK_GROUP)
if Settings.gore:
@@ -204,3 +211,20 @@ func _embed(other: Object, contact: Vector3, flight: Vector3) -> void:
return
freeze = true
global_transform = pose
# Node embedded spears ride on the bull: a BoneAttachment3D pinned to the COG bone so
# they follow the animated body (bob, turn) rather than only the character root. One
# anchor is shared by every spear; falls back to the bull root if there's no skeleton.
static func _spear_anchor(bull: Node) -> Node3D:
var existing := bull.find_child(_ANCHOR_NAME, true, false)
if existing is Node3D:
return existing as Node3D
var skel := bull.find_child("Skeleton3D", true, false) as Skeleton3D
if skel == null:
return bull as Node3D
var ba := BoneAttachment3D.new()
ba.name = _ANCHOR_NAME
skel.add_child(ba)
ba.bone_name = _COG_BONE
return ba
+221
View File
@@ -0,0 +1,221 @@
extends SceneTree
## Bear boss behaviour test. Self-contained: a floor, a real bull (Player.tscn), and the
## bear — no level/shell scene needed. Parks the bull at different range bands and checks
## the bear commits to band-appropriate routines through wind-up→active→recover, that the
## leap lands on the ground (not mid-air), hyper-armour holds mid-swing, and phase 2 +
## death fire. Run: godot --headless --script res://tests/bear_boss_test.gd
var _pass := 0
var _fail := 0
var _bear: Node3D = null
var _bull: Node3D = null
func _init() -> void:
_run.call_deferred()
func _ok(c: bool, m: String) -> void:
if c:
_pass += 1
print(" PASS: ", m)
else:
_fail += 1
print(" FAIL: ", m)
func _base(s: String) -> String:
return s.split(":")[0].trim_suffix("*")
func _dt() -> float:
return 1.0 / Engine.get_physics_ticks_per_second()
# Keep the bull pinned at a flat distance from the bear and alive; report the routine
# bases the bear visits over `secs`.
func _observe(dist: float, secs: float) -> Dictionary:
var seen := {}
var t := 0.0
while t < secs and is_instance_valid(_bear):
_pin_bull(dist)
await physics_frame
t += _dt()
seen[_base(_bear.call("ai_state_name"))] = true
return seen
func _pin_bull(dist: float) -> void:
if _bull == null or not is_instance_valid(_bull):
return
if dist > 0.0:
_bull.global_position = _bear.global_position + Vector3(dist, 0, 0)
_bull.set("_hp", 100000) # never let the bull die and trip a game-over during the test
func _make_floor() -> StaticBody3D:
var body := StaticBody3D.new()
var cs := CollisionShape3D.new()
var box := BoxShape3D.new()
box.size = Vector3(400, 1, 400) # oversized so the bear can't chase the bull off an edge
cs.shape = box
cs.position = Vector3(0, -0.5, 0) # top face at y=0
body.add_child(cs)
return body
func _run() -> void:
root.add_child(_make_floor())
_bull = (load("res://Player.tscn") as PackedScene).instantiate()
root.add_child(_bull)
_bull.global_position = Vector3(4, 1, 0)
_bear = (load("res://Bear.tscn") as PackedScene).instantiate()
root.add_child(_bear)
_bear.global_position = Vector3(0, 1, 0)
await physics_frame
await physics_frame
_ok(_bull.is_in_group(&"player"), "bull is in the player group")
print(" anims: idle=%s run=%s walk2=%s stand=%s swipe=%s smash=%s leap=%s" % [
_bear.get("_anim_idle"), _bear.get("_anim_run"), _bear.get("_anim_walk2"),
_bear.get("_anim_stand"), _bear.get("_anim_swipe"), _bear.get("_anim_smash"),
_bear.get("_anim_leap")])
for k in ["_anim_idle", "_anim_run", "_anim_walk2", "_anim_stand", "_anim_swipe", "_anim_smash", "_anim_leap"]:
_ok(String(_bear.get(k)) != "", "resolved %s" % k)
# Close band → melee (swipe / smash).
var close_seen := await _observe(2.5, 6.0)
print(" close-band states: ", close_seen.keys())
_ok(close_seen.has("SWIPE") or close_seen.has("SMASH"), "close range → melee routine")
# Charge was removed — the bear must never enter it.
_ok(not close_seen.has("CHARGE"), "no charge routine (removed)")
# It must not climb on top of the bull: pressed right up against a pinned bull while
# doing melee (never leaping), the grounded bear's height must stay near the floor.
var max_y := -INF
var ct := 0.0
while ct < 4.0 and is_instance_valid(_bear):
_pin_bull(1.5)
await physics_frame
ct += _dt()
if not String(_bear.call("ai_state_name")).begins_with("LEAP"):
max_y = maxf(max_y, _bear.global_position.y)
_ok(max_y < 0.6, "bear does not climb on top of the bull (max grounded y=%.2f)" % max_y)
# Claw slashes: an emitter is bound to each paw, and one fires during the 1-2 punch.
_ok(_bear.get("_claw_l") != null and _bear.get("_claw_r") != null, "claw emitters bound to both paws")
var clawed := false
var wt := 0.0
while wt < 8.0 and is_instance_valid(_bear) and not clawed:
_pin_bull(2.5)
await physics_frame
wt += _dt()
var cl: CPUParticles3D = _bear.get("_claw_l")
var cr: CPUParticles3D = _bear.get("_claw_r")
if (cl != null and cl.emitting) or (cr != null and cr.emitting):
clawed = true
_ok(clawed, "claw slash emits during the 1-2 punch")
# Mid band → walk-in (stalk) or leap.
var mid_seen := await _observe(7.0, 8.0)
print(" mid-band states: ", mid_seen.keys())
_ok(mid_seen.has("STALK") or mid_seen.has("LEAP"), "mid range → stalk/leap")
# Routines reach ACTIVE (hit) and RECOVER (punish) phases.
var saw_active := false
var saw_recover := false
var t := 0.0
while t < 8.0 and is_instance_valid(_bear):
_pin_bull(2.5)
await physics_frame
t += _dt()
var s: String = _bear.call("ai_state_name")
if s.contains(":ACTIVE"): saw_active = true
if s.contains(":RECOVER"): saw_recover = true
_ok(saw_active, "routines reach their ACTIVE (hit) phase")
_ok(saw_recover, "routines reach their RECOVER (punish) phase")
# Leap must actually get airborne and then LAND before it recovers — the slam lands on
# the ground (impact frame), not mid-air. Reset the bear to a known grounded spot, then
# force one leap deterministically and follow it.
_bear.call("_enter_neutral")
_bear.global_position = Vector3(0, 1, 0)
_bear.velocity = Vector3.ZERO
var settle := 0
while settle < 30 and not _bear.is_on_floor():
_pin_bull(7.0)
await physics_frame
settle += 1
var start_y: float = _bear.global_position.y
_bear.call("_start_leap")
var peak_y := start_y
var recovered_on_floor := false
var recovered_airborne := false
var reached_recover := false
t = 0.0
while t < 4.0 and is_instance_valid(_bear):
_pin_bull(7.0)
await physics_frame
t += _dt()
peak_y = maxf(peak_y, _bear.global_position.y)
var s: String = _bear.call("ai_state_name")
if s.begins_with("LEAP:RECOVER"):
reached_recover = true
if _bear.is_on_floor(): recovered_on_floor = true
else: recovered_airborne = true
break
_ok(peak_y > start_y + 0.3, "leap gets airborne (peak +%.2fm)" % (peak_y - start_y))
_ok(reached_recover, "leap reaches its slam/recovery")
_ok(recovered_on_floor and not recovered_airborne,
"leap lands on the ground before recovering (frame-25 contact, no mid-air finish)")
# Hyper-armour: let the bear commit to a swing, then hit it — it must NOT drop into
# STAGGER mid-swing (only its recovery is punishable), yet it must still take the wound.
var in_active := false
t = 0.0
while t < 8.0 and is_instance_valid(_bear) and not in_active:
_pin_bull(2.5)
await physics_frame
t += _dt()
in_active = String(_bear.call("ai_state_name")).contains(":ACTIVE")
_ok(in_active, "bear commits to an ACTIVE swing")
var hp_before := int(_bear.get("_hp"))
var staggered_mid_swing := false
var i := 0
while i < 8 and is_instance_valid(_bear) and String(_bear.call("ai_state_name")).contains(":ACTIVE"):
_pin_bull(2.5)
_bear.call("apply_ability_hit", Vector3.RIGHT, 10.0, 0.0)
await physics_frame
if String(_bear.call("ai_state_name")).begins_with("STAGGER"):
staggered_mid_swing = true
i += 1
_ok(not staggered_mid_swing, "hyper-armour: hits during a swing don't stagger it")
_ok(int(_bear.get("_hp")) < hp_before, "bear still takes damage during the swing")
# Drive HP down (spaced out so it isn't stun-locked) and confirm phase 2 engages.
t = 0.0
while t < 8.0 and is_instance_valid(_bear) and not bool(_bear.get("_enraged")):
_pin_bull(2.5)
_bear.call("apply_ability_hit", Vector3.RIGHT, 10.0, 0.0)
for _f in range(18): # ~0.3s gap between hits
_pin_bull(2.5)
await physics_frame
t += _dt()
_ok(bool(_bear.get("_enraged")), "phase 2 (enrage) triggered below the HP fraction")
# Finish it off and confirm death + free.
for _k in range(int(_bear.get("_hp")) + 2):
if is_instance_valid(_bear):
_bear.call("apply_ability_hit", Vector3.RIGHT, 12.0, 0.0)
for _f in range(3):
await physics_frame
await physics_frame
_ok(is_instance_valid(_bear) and not _bear.call("is_active"), "bear dead after HP drained")
await create_timer(6.0).timeout
_ok(not is_instance_valid(_bear), "bear freed after death topple")
print("Results: %d passed, %d failed" % [_pass, _fail])
quit(1 if _fail > 0 else 0)
+1
View File
@@ -0,0 +1 @@
uid://c7wjoqgkpsepj
+72
View File
@@ -0,0 +1,72 @@
extends SceneTree
## Level-isolation test: when the shell loads the Bear's Den, none of the arena level's
## geometry — crucially its wall/floor colliders and audience — may survive into it.
## Guards the modular-level contract: switching levels swaps the whole module, it never
## hides old nodes (hidden colliders still collide). Run:
## godot --headless --script tests/level_switch_test.gd
var _pass := 0
var _fail := 0
func _init() -> void:
_run.call_deferred()
func _ok(c: bool, m: String) -> void:
if c:
_pass += 1
print(" PASS: ", m)
else:
_fail += 1
print(" FAIL: ", m)
func _count_named(node: Node, wanted: String, acc: int = 0) -> int:
if node.name == wanted:
acc += 1
for child: Node in node.get_children():
acc = _count_named(child, wanted, acc)
return acc
func _count_type(node: Node, klass: String, acc: int = 0) -> int:
if node.is_class(klass):
acc += 1
for child: Node in node.get_children():
acc = _count_type(child, klass, acc)
return acc
func _run() -> void:
var run: Node = root.get_node("Run")
run.ensure_run()
# Force the shell to build the Bear's Den regardless of the generated map.
run.debug_level_override = run.get_level(&"bear")
var scene: Node = load("res://scene.tscn").instantiate()
root.add_child(scene)
current_scene = scene
# Let the shell instance the level and the spawner's deferred spawn run.
await create_timer(0.8).timeout
# Shell survives and hosts exactly one level module.
var level_root: Node = scene.get_node_or_null("LevelRoot")
_ok(level_root != null, "shell has a LevelRoot")
_ok(level_root != null and level_root.get_child_count() == 1, "exactly one level module loaded")
_ok(not get_nodes_in_group(&"player").is_empty(), "player (shell) present")
# The leak we are guarding against: no arena geometry may exist in the bear level.
_ok(_count_named(scene, "arena_placeholder_v01") == 0, "arena placeholder (+ its wall collider) gone")
_ok(_count_named(scene, "Arena2") == 0, "arena mesh 'Arena2' gone")
_ok(_count_named(scene, "PublikNode") == 0, "arena audience gone from bear level")
# The bear level brings its own geometry, one floor collider, and its boss.
_ok(_count_named(scene, "bear_level_arena") == 1, "bear arena mesh present")
_ok(_count_type(level_root, "StaticBody3D") >= 1, "bear level has its own floor collider")
await create_timer(0.4).timeout
_ok(not get_nodes_in_group(&"bear").is_empty(), "bear boss spawned in bear level")
print("Results: %d passed, %d failed" % [_pass, _fail])
quit(1 if _fail > 0 else 0)
+1
View File
@@ -0,0 +1 @@
uid://b6ud4uune1clf
+55
View File
@@ -30,6 +30,7 @@ func _run() -> void:
test_kick_spread()
test_gait_phase_crossing()
test_tail_verlet_constraint()
test_run_map()
print("=" .repeat(60))
print("Results: %d passed, %d failed" % [_passed, _failed])
@@ -171,6 +172,60 @@ func test_tail_verlet_constraint() -> void:
_assert_in_range(damping_factor, 0.85, 1.0, "tail damping factor is reasonable")
# ── Run map (Slay-the-Spire progression) ──────────────────────────────────────
func test_run_map() -> void:
print("\n-- test_run_map --")
var run: Node = root.get_node_or_null("/root/Run")
if run == null:
_assert_true(false, "Run autoload should exist")
return
run.start_new_run()
_assert_true(run.has_run(), "start_new_run builds a map")
_assert_true(run.map.size() >= 2, "map has multiple rows")
# Final row is a single boss node the map funnels toward.
var last: Array = run.map[run.map.size() - 1]
_assert_eq(last.size(), 1, "final row is a single boss node")
_assert_true(last[0].level.is_boss, "final node is a boss level")
# Connectivity: every node links forward, and every next-row node has a parent.
for r: int in run.map.size() - 1:
var nxt: Array = run.map[r + 1]
var reached := {}
for from_node in run.map[r]:
_assert_true(from_node.links.size() >= 1, "row %d node links forward" % r)
for c: int in from_node.links:
_assert_true(c >= 0 and c < nxt.size(), "link column in range")
reached[c] = true
for c: int in nxt.size():
_assert_true(reached.has(c), "row %d col %d has a parent" % [r + 1, c])
# From the start gate the whole first row is the frontier.
_assert_eq(run.reachable().size(), run.map[0].size(), "start frontier is row 0")
# Advancing follows the chosen node's links.
var first = run.map[0][0]
run.select_node(first)
run.complete_current_level()
_assert_eq(run.player_row, 0, "player advanced to row 0")
_assert_true(first.cleared, "cleared node is flagged")
_assert_eq(run.reachable().size(), first.links.size(),
"frontier follows the chosen node's links")
# Walking to a boss node latches run completion.
var guard := 0
while not run.run_complete() and guard < 64:
var opts: Array = run.reachable()
if opts.is_empty():
break
run.select_node(opts[0])
run.complete_current_level()
guard += 1
_assert_true(run.run_complete(), "reaching a boss node completes the run")
# ── Shared helpers ────────────────────────────────────────────────────────────
func _assert_in_range(val: float, lo: float, hi: float, desc: String) -> void:
+66
View File
@@ -0,0 +1,66 @@
extends SceneTree
## Repro harness for the "bull + matador invisible on phone" bug. Loads the shell with the
## arena level, waits for spawn, prints vis/pos for the skinned characters and dumps a real
## screenshot so the Compatibility (mobile/web) render path can be compared to Forward+.
## godot --rendering-method gl_compatibility --script tests/mobile_render_repro.gd
## godot --rendering-method forward_plus --script tests/mobile_render_repro.gd
func _init() -> void:
_run.call_deferred()
func _report(nodes: Array, label: String) -> void:
if nodes.is_empty():
print(" ", label, ": NONE")
return
var n := nodes[0] as Node3D
print(" ", label, ": vis=", n.is_visible_in_tree(), " pos=", str(n.global_position.round()))
# Walk to the skinned MeshInstance3D and report its state + AABB.
_dump_meshes(n, " ")
func _dump_meshes(node: Node, indent: String) -> void:
if node is MeshInstance3D:
var mi := node as MeshInstance3D
var aabb := mi.get_aabb()
var lod_count := 0
var surf := 0
if mi.mesh != null:
surf = mi.mesh.get_surface_count()
print(indent, "MeshInstance3D '", mi.name, "' vis=", mi.visible,
" skin=", mi.skin != null, " gscale=", str(mi.global_transform.basis.get_scale()),
"\n", indent, " aabb_pos=", aabb.position, " aabb_size=", aabb.size,
" custom_aabb=", mi.custom_aabb.size, " surfaces=", surf)
for c: Node in node.get_children():
_dump_meshes(c, indent)
func _run() -> void:
# Compatibility (OpenGL) has no RenderingDevice; Forward+/Mobile do. This reflects the
# renderer actually chosen by --rendering-method, unlike the static project setting.
var method := "gl_compatibility" if RenderingServer.get_rendering_device() == null else "forward_plus"
print("=== RENDER REPRO method=", method, " gpu=", RenderingServer.get_video_adapter_name(), " ===")
var run: Node = root.get_node("Run")
run.ensure_run()
run.debug_level_override = run.get_level(&"arena")
var scene: Node = load("res://scene.tscn").instantiate()
root.add_child(scene)
current_scene = scene
await create_timer(1.2).timeout
print("bull + matador state:")
_report(get_nodes_in_group(&"player"), "bull")
_report(get_nodes_in_group(&"matador"), "matador")
# Force a couple more draw frames, then grab the framebuffer.
for i in 4:
await process_frame
var img := root.get_viewport().get_texture().get_image()
var out := "tests/output/render_%s.png" % method
DirAccess.make_dir_recursive_absolute("res://tests/output")
img.save_png("res://" + out)
print("screenshot -> ", out, " (", img.get_width(), "x", img.get_height(), ")")
quit()
+1
View File
@@ -0,0 +1 @@
uid://dvkw2a6cf7848
+32
View File
@@ -0,0 +1,32 @@
extends Node3D
## Minimal skinned-mesh probe for the web/mobile invisibility repro. Boots straight to a
## single bull (Skeleton3D-skinned) framed by a camera + light, no menus, no autoload deps.
## Set as main_scene, exported to web, and screenshotted in a browser to test whether the
## skinned mesh draws under a given engine build.
func _ready() -> void:
var bull := (load("res://Assets/bull.fbx") as PackedScene).instantiate() as Node3D
bull.scale = Vector3(100.0, 100.0, 100.0)
add_child(bull)
var key := DirectionalLight3D.new()
key.rotation_degrees = Vector3(-50.0, -40.0, 0.0)
key.light_energy = 1.5
add_child(key)
var we := WorldEnvironment.new()
var env := Environment.new()
env.background_mode = Environment.BG_COLOR
env.background_color = Color(0.15, 0.35, 0.65)
env.ambient_light_source = Environment.AMBIENT_SOURCE_COLOR
env.ambient_light_color = Color(0.6, 0.6, 0.6)
env.ambient_light_energy = 1.0
we.environment = env
add_child(we)
var cam := Camera3D.new()
cam.position = Vector3(0.0, 2.0, 6.0)
cam.fov = 55.0
add_child(cam)
cam.look_at(Vector3(0.0, 1.2, 0.0), Vector3.UP)
cam.current = true
+1
View File
@@ -0,0 +1 @@
uid://dhu2og7i2gdfa
+6
View File
@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://cwebprobe0001"]
[ext_resource type="Script" path="res://tests/web_probe.gd" id="1"]
[node name="WebProbe" type="Node3D"]
script = ExtResource("1")
+387 -190
View File
@@ -2,15 +2,23 @@ extends CanvasLayer
## On-screen controls for touch devices: a floating movement joystick on the left
## and a cluster of ability buttons on the right. Instantiated by hud.gd.
##
## The joystick feeds the same `move_*` input actions the keyboard/gamepad drive
## (via Input.action_press with an analog strength), so player.gd needs no touch
## awareness — it just reads Input.get_vector() as always. Ability buttons call the
## player's public try_activate_ability(), which shares the keyboard's cooldown gate.
## All interaction is driven from raw `_input()` with manual hit-testing, NOT from
## Control.gui_input. On the web/wasm build the overlay lives in a CanvasLayer nested
## under the HUD, and GUI touch routing into a nested CanvasLayer renders fine but
## silently drops input — a standard Button here never fires. `_input()` sees every
## InputEventScreenTouch regardless of nesting, mouse_filter, or emulate_mouse_from_touch,
## so the joystick and buttons work reliably across browsers. Everything is drawn in one
## Control (_surface) whose rects are the single source of truth for both drawing and
## hit-testing.
##
## The joystick feeds the same `move_*` input actions the keyboard/gamepad drive (via
## Input.action_press with an analog strength), so player.gd needs no touch awareness — it
## just reads Input.get_vector() as always. Ability buttons call the player's public
## try_activate_ability(), sharing the keyboard's cooldown gate.
##
## Shown only on touch platforms (see Controls.use_touch_ui), or when DP
## "force_touch_controls" is on so the layout can be exercised on a desktop build.
## emulate_touch_from_mouse (project.godot) lets a mouse stand in for a finger while
## testing.
## "force_touch_controls" is on so the layout can be exercised on a desktop build
## (emulate_touch_from_mouse turns a mouse click into a touch event for that).
# move_* actions, indexed by the four joystick push directions.
const _MOVE_RIGHT: StringName = &"move_right"
@@ -33,80 +41,234 @@ const _ABILITY_ACCENT: Array[Color] = [
Color(1.00, 0.82, 0.32), # Roll — gold
]
var _root: Control
var _stick: Control
var _cd_overlays: Array[ColorRect] = []
# Sentinel touch indices. A real finger uses its own non-negative index; the mouse
# (desktop force-flag testing, when no real touch has been seen) uses _MOUSE.
const _MOUSE: int = -2
var _surface: Control
var _player: Node = null
# Floating-joystick state. _origin is where the thumb first touched (base centre),
# _knob is the current thumb position; both in _stick-local coordinates. _touch_index
# is the finger owning the stick (-1 = none, -2 = mouse), so a second finger tapping
# an ability button never steals the stick.
# Cached textures + styleboxes so the per-frame redraw (cooldowns animate) allocates nothing.
var _ability_tex: Array[Texture2D] = []
var _ability_style: Array[StyleBoxFlat] = []
var _menu_style: StyleBoxFlat
# Layout rects in screen space — the single source of truth for drawing AND hit-testing.
var _stick_zone: Rect2 = Rect2()
var _ability_rects: Array[Rect2] = []
var _menu_rect: Rect2 = Rect2()
# Resting "drag to move" affordance drawn in the lower-left when the stick is idle, so a
# first-time player sees where to plant their thumb instead of guessing. _hint_pulse gives
# it a slow breathing alpha for discoverability.
var _stick_hint_center: Vector2 = Vector2()
var _hint_pulse: float = 0.0
# Floating-joystick state. _origin is where the thumb first touched (base centre), _knob is
# the current thumb position; both in screen coordinates.
var _stick_active: bool = false
var _origin: Vector2 = Vector2.ZERO
var _knob: Vector2 = Vector2.ZERO
var _touch_index: int = -3
var _stick_radius: float = 110.0
# Live fingers by index → screen position, plus what each finger is doing ("stick", a slot
# int, "menu", or "camera"). Ownership keeps a second finger on a button from stealing the
# stick, and keeps steering/ability fingers from being mistaken for a pinch gesture.
var _touches: Dictionary = {}
var _touch_owner: Dictionary = {}
var _saw_real_touch: bool = false
# Pinch-to-zoom: only "camera" fingers (right side, not on any button) count, so steering
# with one thumb while tapping an ability with the other never reads as a zoom.
var _pinching: bool = false
var _pinch_dist: float = 0.0
# Diagnostics surfaced by DP "touch_debug" — lets us see, on the actual device, whether
# events arrive and where, since no console is reachable there.
var _dbg_events: int = 0
var _dbg_last_pos: Vector2 = Vector2.ZERO
# Cached real GPU name. RenderingServer.get_video_adapter_name() returns the browser's
# privacy-masked "WebKit WebGL" on the web; the true chip (Adreno/Mali/…) — which decides
# whether an invisible skinned mesh is a known mobile-driver bug — is only reachable via
# the WEBGL_debug_renderer_info extension on Godot's own canvas context. "" = not yet probed.
var _gpu_unmasked: String = ""
func _unmasked_gpu() -> String:
if _gpu_unmasked != "":
return _gpu_unmasked
_gpu_unmasked = "n/a"
if OS.has_feature("web"):
var js := """(function(){try{
var c=document.getElementById('canvas');
var gl=c?c.getContext('webgl2'):null;
if(!gl){var t=document.createElement('canvas');gl=t.getContext('webgl2')||t.getContext('webgl');}
if(!gl)return 'no-gl';
var e=gl.getExtension('WEBGL_debug_renderer_info');
if(!e)return 'masked';
return String(gl.getParameter(e.UNMASKED_RENDERER_WEBGL));
}catch(err){return 'err';}})()"""
var r: Variant = JavaScriptBridge.eval(js, true)
if r is String and (r as String) != "":
_gpu_unmasked = r
return _gpu_unmasked
func _ready() -> void:
layer = 10 # below the HUD (11) so the game-over screen always draws on top
process_mode = Node.PROCESS_MODE_ALWAYS
_root = Control.new()
_root.set_anchors_preset(Control.PRESET_FULL_RECT)
_root.mouse_filter = Control.MOUSE_FILTER_IGNORE
_root.visible = false
add_child(_root)
for slot: int in 4:
var tex: Texture2D = null
if ResourceLoader.exists(_ABILITY_ICONS[slot]):
tex = load(_ABILITY_ICONS[slot])
_ability_tex.append(tex)
_ability_style.append(_button_style(_ABILITY_ACCENT[slot]))
_menu_style = _button_style(Color(1.00, 0.78, 0.22, 0.8))
_surface = Control.new()
_surface.set_anchors_preset(Control.PRESET_FULL_RECT)
_surface.mouse_filter = Control.MOUSE_FILTER_IGNORE
_surface.visible = false
_surface.draw.connect(_draw_surface)
add_child(_surface)
_build_joystick()
_build_ability_buttons()
_build_menu_button()
_relayout()
get_viewport().size_changed.connect(_relayout)
# ── Joystick ────────────────────────────────────────────────────────────────
# The stick zone is the whole left half of the screen: touching anywhere in it
# plants the base under the thumb, so the player never has to find a fixed pad.
# ── Layout ────────────────────────────────────────────────────────────────────
# Left half is the joystick zone (touch anywhere in it to plant the base under the thumb);
# the ability cluster and menu button sit in the right half so they never overlap it.
func _build_joystick() -> void:
_stick = Control.new()
_stick.mouse_filter = Control.MOUSE_FILTER_STOP
_stick.gui_input.connect(_on_stick_input)
_stick.draw.connect(_draw_stick)
_root.add_child(_stick)
func _relayout() -> void:
var vp := get_viewport().get_visible_rect().size
var short := minf(vp.x, vp.y)
_stick_radius = clampf(short * 0.16, 80.0, 150.0)
_stick_zone = Rect2(Vector2.ZERO, Vector2(vp.x * 0.5, vp.y))
var bs := clampf(short * 0.16, 72.0, 120.0) # ability button edge
var gap := bs * 0.18
var margin := bs * 0.28
var right := vp.x - margin
var bottom := vp.y - margin
var col0 := right - bs * 2.0 - gap
var col1 := right - bs
var row0 := bottom - bs * 2.0 - gap
var row1 := bottom - bs
_ability_rects = [
Rect2(col0, row0, bs, bs), # kick
Rect2(col1, row0, bs, bs), # dash
Rect2(col0, row1, bs, bs), # slam
Rect2(col1, row1, bs, bs), # roll
]
var ms := clampf(short * 0.09, 48.0, 72.0)
_menu_rect = Rect2(vp.x - ms - 16.0, 16.0, ms, ms)
_stick_hint_center = Vector2(vp.x * 0.20, vp.y * 0.74)
_surface.queue_redraw()
func _on_stick_input(event: InputEvent) -> void:
# ── Input ───────────────────────────────────────────────────────────────────
# Raw events only. Real touches drive the touch path; once any real touch is seen the
# mouse path is disabled (emulate_mouse_from_touch would otherwise double-fire every tap).
# The mouse path stays live for desktop force-flag testing where no touchscreen exists.
func _input(event: InputEvent) -> void:
if get_tree().paused or not Controls.use_touch_ui():
return
if event is InputEventScreenTouch:
_saw_real_touch = true
var t := event as InputEventScreenTouch
if t.pressed and not _stick_active:
_begin_stick(t.position, t.index)
elif not t.pressed and _touch_index == t.index:
_end_stick()
_dbg_events += 1
_dbg_last_pos = t.position
if t.pressed:
_touches[t.index] = t.position
_on_press(t.index, t.position)
else:
_on_release(t.index, t.position)
_touches.erase(t.index)
_update_pinch_state()
_surface.queue_redraw()
get_viewport().set_input_as_handled()
elif event is InputEventScreenDrag:
var d := event as InputEventScreenDrag
if _touch_index == d.index:
_update_stick(d.position)
elif event is InputEventMouseButton:
_dbg_events += 1
_dbg_last_pos = d.position
_touches[d.index] = d.position
_on_drag(d.index, d.position)
_surface.queue_redraw()
get_viewport().set_input_as_handled()
elif not _saw_real_touch and event is InputEventMouseButton:
var mb := event as InputEventMouseButton
if mb.button_index == MOUSE_BUTTON_LEFT:
if mb.pressed and not _stick_active:
_begin_stick(mb.position, -2)
elif not mb.pressed and _touch_index == -2:
_end_stick()
elif event is InputEventMouseMotion and _touch_index == -2:
_update_stick((event as InputEventMouseMotion).position)
_dbg_events += 1
_dbg_last_pos = mb.position
if mb.pressed:
_touches[_MOUSE] = mb.position
_on_press(_MOUSE, mb.position)
else:
_on_release(_MOUSE, mb.position)
_touches.erase(_MOUSE)
_update_pinch_state()
_surface.queue_redraw()
elif not _saw_real_touch and event is InputEventMouseMotion:
if _touch_owner.get(_MOUSE, null) == "stick":
_touches[_MOUSE] = (event as InputEventMouseMotion).position
_update_stick(_touches[_MOUSE])
_surface.queue_redraw()
func _begin_stick(pos: Vector2, index: int) -> void:
func _on_press(index: int, pos: Vector2) -> void:
if _menu_rect.has_point(pos):
_touch_owner[index] = "menu"
return
for slot: int in _ability_rects.size():
if _ability_rects[slot].has_point(pos):
_touch_owner[index] = slot
if _player != null:
_player.call(&"try_activate_ability", slot)
return
if _stick_zone.has_point(pos) and not _stick_active:
_touch_owner[index] = "stick"
_begin_stick(pos)
return
_touch_owner[index] = "camera"
func _on_drag(index: int, pos: Vector2) -> void:
match _touch_owner.get(index, null):
"stick":
_update_stick(pos)
"camera":
if _pinching:
_apply_pinch()
func _on_release(index: int, pos: Vector2) -> void:
match _touch_owner.get(index, null):
"stick":
_end_stick()
"menu":
if _menu_rect.has_point(pos):
_touch_owner.erase(index)
_return_to_menu()
return
_touch_owner.erase(index)
# ── Joystick ────────────────────────────────────────────────────────────────
func _begin_stick(pos: Vector2) -> void:
_stick_active = true
_touch_index = index
_origin = pos
_knob = pos
_stick.queue_redraw()
func _update_stick(pos: Vector2) -> void:
@@ -117,19 +279,16 @@ func _update_stick(pos: Vector2) -> void:
offset = offset.normalized() * _stick_radius
_knob = _origin + offset
_apply_move(offset / _stick_radius)
_stick.queue_redraw()
func _end_stick() -> void:
_stick_active = false
_touch_index = -3
_release_move()
_stick.queue_redraw()
# Translate a normalised stick offset (screen space: +x right, +y down) into analog
# strengths on the four movement actions. Opposite pairs are mutually exclusive, so
# only one of each axis is ever pressed at a time.
# strengths on the four movement actions. Opposite pairs are mutually exclusive, so only
# one of each axis is ever pressed at a time.
func _apply_move(v: Vector2) -> void:
Input.action_press(_MOVE_RIGHT, maxf(0.0, v.x))
Input.action_press(_MOVE_LEFT, maxf(0.0, -v.x))
@@ -142,139 +301,185 @@ func _release_move() -> void:
Input.action_release(action)
func _draw_stick() -> void:
if not _stick_active:
# ── Pinch-to-zoom ─────────────────────────────────────────────────────────────
# Only "camera" fingers (open right-side area, not on a button) participate, so it can't
# fire while the player is steering or tapping abilities.
func _camera_touches() -> Array:
var pts: Array = []
for idx: int in _touches:
if _touch_owner.get(idx, null) == "camera":
pts.append(_touches[idx])
return pts
func _update_pinch_state() -> void:
var pts := _camera_touches()
var was := _pinching
_pinching = pts.size() >= 2
if _pinching and not was:
if _stick_active:
_end_stick()
_pinch_dist = (pts[0] as Vector2).distance_to(pts[1] as Vector2)
elif was and not _pinching:
_pinch_dist = 0.0
func _apply_pinch() -> void:
var pts := _camera_touches()
if pts.size() < 2:
return
var ring := Color(0.93, 0.88, 0.72, 0.30)
var knob := Color(1.00, 0.82, 0.32, 0.55)
_stick.draw_circle(_origin, _stick_radius, Color(0.0, 0.0, 0.0, 0.20))
_stick.draw_arc(_origin, _stick_radius, 0.0, TAU, 48, ring, 4.0, true)
_stick.draw_circle(_knob, _stick_radius * 0.42, knob)
var dist := (pts[0] as Vector2).distance_to(pts[1] as Vector2)
if _pinch_dist <= 0.0 or dist <= 0.0:
_pinch_dist = dist
return
var cam := get_viewport().get_camera_3d()
if cam != null and cam.has_method(&"adjust_zoom"):
cam.call(&"adjust_zoom", dist / _pinch_dist)
_pinch_dist = dist
# ── Ability buttons ─────────────────────────────────────────────────────────
# A 2×2 cluster in the bottom-right thumb reach. Each button taps the matching
# ability; a dark overlay wipes down over it while that ability is cooling down.
# ── Drawing ───────────────────────────────────────────────────────────────────
func _build_ability_buttons() -> void:
var grid := GridContainer.new()
grid.name = "AbilityGrid"
grid.columns = 2
grid.add_theme_constant_override("h_separation", 14)
grid.add_theme_constant_override("v_separation", 14)
grid.mouse_filter = Control.MOUSE_FILTER_IGNORE
grid.anchor_left = 1.0
grid.anchor_right = 1.0
grid.anchor_top = 1.0
grid.anchor_bottom = 1.0
grid.grow_horizontal = Control.GROW_DIRECTION_BEGIN
grid.grow_vertical = Control.GROW_DIRECTION_BEGIN
grid.offset_left = -220.0
grid.offset_top = -220.0
grid.offset_right = -24.0
grid.offset_bottom = -24.0
_root.add_child(grid)
func _draw_surface() -> void:
for slot: int in _ability_rects.size():
var r: Rect2 = _ability_rects[slot]
_surface.draw_style_box(_ability_style[slot], r)
var inner := r.grow(-r.size.x * 0.14)
if _ability_tex[slot] != null:
_draw_icon_fit(_ability_tex[slot], inner)
else:
_draw_centered_text(_ABILITY_LETTERS[slot], r, 40, _ABILITY_ACCENT[slot])
var frac := 0.0
if _player != null:
frac = clampf(_player.call(&"ability_cooldown_fraction", slot), 0.0, 1.0)
if frac > 0.0:
var ch := r.size.y * frac
_surface.draw_rect(
Rect2(r.position.x, r.position.y + r.size.y - ch, r.size.x, ch),
Color(0.0, 0.0, 0.0, 0.55))
for slot: int in 4:
grid.add_child(_build_ability_button(slot))
_surface.draw_style_box(_menu_style, _menu_rect)
_draw_hamburger(_menu_rect)
if _stick_active:
_surface.draw_circle(_origin, _stick_radius, Color(0.0, 0.0, 0.0, 0.20))
_surface.draw_arc(
_origin, _stick_radius, 0.0, TAU, 48, Color(0.93, 0.88, 0.72, 0.30), 4.0, true)
_surface.draw_circle(_knob, _stick_radius * 0.42, Color(1.00, 0.82, 0.32, 0.55))
elif not _pinching:
_draw_stick_hint()
if Controls.debug_overlay():
_draw_debug()
func _build_ability_button(slot: int) -> Control:
var panel := PanelContainer.new()
panel.custom_minimum_size = Vector2(96.0, 96.0)
panel.add_theme_stylebox_override("panel", _button_style(slot))
panel.mouse_filter = Control.MOUSE_FILTER_STOP
var stack := Control.new()
stack.set_anchors_preset(Control.PRESET_FULL_RECT)
panel.add_child(stack)
if ResourceLoader.exists(_ABILITY_ICONS[slot]):
var icon := TextureRect.new()
icon.texture = load(_ABILITY_ICONS[slot])
icon.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
icon.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
icon.set_anchors_preset(Control.PRESET_FULL_RECT)
icon.mouse_filter = Control.MOUSE_FILTER_IGNORE
stack.add_child(icon)
else:
var lbl := Label.new()
lbl.text = _ABILITY_LETTERS[slot]
lbl.set_anchors_preset(Control.PRESET_FULL_RECT)
lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
lbl.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
lbl.mouse_filter = Control.MOUSE_FILTER_IGNORE
lbl.add_theme_color_override("font_color", _ABILITY_ACCENT[slot])
lbl.add_theme_font_size_override("font_size", 40)
stack.add_child(lbl)
# Cooldown wipe — anchored to the bottom, its top edge driven in _process so it
# shrinks away as the ability comes off cooldown (mirrors the desktop HUD tiles).
var cd := ColorRect.new()
cd.color = Color(0.0, 0.0, 0.0, 0.62)
cd.anchor_left = 0.0
cd.anchor_right = 1.0
cd.anchor_top = 1.0
cd.anchor_bottom = 1.0
cd.mouse_filter = Control.MOUSE_FILTER_IGNORE
stack.add_child(cd)
_cd_overlays.append(cd)
# Fire on press (not release) so abilities feel instant under the thumb.
panel.gui_input.connect(_on_ability_input.bind(slot))
return panel
# A faint "ghost" joystick at rest in the lower-left with a caption, so the movement zone
# is discoverable. Breathes gently via _hint_pulse; vanishes the moment the stick is grabbed.
func _draw_stick_hint() -> void:
var a := 0.16 + 0.12 * (0.5 + 0.5 * sin(_hint_pulse))
var c := _stick_hint_center
var r := _stick_radius * 0.72
_surface.draw_circle(c, r, Color(0.0, 0.0, 0.0, a * 0.45))
_surface.draw_arc(c, r, 0.0, TAU, 40, Color(0.93, 0.88, 0.72, a + 0.14), 3.0, true)
_surface.draw_circle(c, r * 0.32, Color(1.00, 0.82, 0.32, a + 0.16))
var font := ThemeDB.fallback_font
if font != null:
var txt := "DRAG TO MOVE"
var fs := 18
var tw := font.get_string_size(txt, HORIZONTAL_ALIGNMENT_LEFT, -1, fs)
_surface.draw_string(
font, c + Vector2(-tw.x * 0.5, r + 28.0), txt, HORIZONTAL_ALIGNMENT_LEFT, -1, fs,
Color(0.93, 0.88, 0.72, a + 0.30))
func _on_ability_input(event: InputEvent, slot: int) -> void:
var pressed := false
if event is InputEventScreenTouch:
pressed = (event as InputEventScreenTouch).pressed
elif event is InputEventMouseButton:
var mb := event as InputEventMouseButton
pressed = mb.pressed and mb.button_index == MOUSE_BUTTON_LEFT
if pressed and _player != null:
_player.call(&"try_activate_ability", slot)
func _draw_icon_fit(tex: Texture2D, box: Rect2) -> void:
var ts := tex.get_size()
if ts.x <= 0.0 or ts.y <= 0.0:
return
var scale := minf(box.size.x / ts.x, box.size.y / ts.y)
var ds := ts * scale
_surface.draw_texture_rect(tex, Rect2(box.position + (box.size - ds) * 0.5, ds), false)
func _button_style(slot: int) -> StyleBoxFlat:
func _draw_centered_text(text: String, box: Rect2, size: int, color: Color) -> void:
var font := ThemeDB.fallback_font
if font == null:
return
var tw := font.get_string_size(text, HORIZONTAL_ALIGNMENT_LEFT, -1, size)
var pos := box.position + (box.size - tw) * 0.5 + Vector2(0.0, tw.y * 0.35)
_surface.draw_string(font, pos, text, HORIZONTAL_ALIGNMENT_LEFT, -1, size, color)
# Three stacked bars — a "☰" glyph drawn by hand, since the fallback font that ships with
# the web build has no U+2630 and renders it as tofu / a codepoint number.
func _draw_hamburger(r: Rect2) -> void:
var col := Color(1.00, 0.78, 0.22)
var bw := r.size.x * 0.5
var bh := maxf(3.0, r.size.y * 0.09)
var x := r.position.x + (r.size.x - bw) * 0.5
var cy := r.position.y + r.size.y * 0.5
var gap := r.size.y * 0.22
for i: int in [-1, 0, 1]:
_surface.draw_rect(Rect2(x, cy + i * gap - bh * 0.5, bw, bh), col)
func _draw_debug() -> void:
var font := ThemeDB.fallback_font
if font == null:
return
var players := get_tree().get_nodes_in_group(&"player")
var mats := get_tree().get_nodes_in_group(&"matador")
var lines := [
"GPU: %s" % RenderingServer.get_video_adapter_name(),
"chip: %s" % _unmasked_gpu(),
"API: %s" % RenderingServer.get_video_adapter_api_version(),
"method=%s web=%s touch_ui=%s" % [
ProjectSettings.get_setting("rendering/renderer/rendering_method", "?"),
OS.has_feature("web"), Controls.use_touch_ui()],
"bull: %s" % _node_report(players),
"matador(%d): %s" % [mats.size(), _node_report(mats)],
"events=%d last=%s touches=%d stick=%s" % [
_dbg_events, str(_dbg_last_pos.round()), _touches.size(), _stick_active],
]
var fs := 18
var line_h := 24.0
var w := 0.0
for line: String in lines:
w = maxf(w, font.get_string_size(line, HORIZONTAL_ALIGNMENT_LEFT, -1, fs).x)
_surface.draw_rect(
Rect2(10.0, 34.0, w + 16.0, line_h * lines.size() + 12.0), Color(0.0, 0.0, 0.0, 0.62))
var y := 34.0 + 22.0
for line: String in lines:
_surface.draw_string(
font, Vector2(18.0, y), line, HORIZONTAL_ALIGNMENT_LEFT, -1, fs,
Color(1.0, 1.0, 0.3))
y += line_h
# One-line "does this character exist / is it drawable / where is it" report for the debug
# overlay, so an invisible bull/matador on-device can be pinned to spawn vs. position vs.
# GPU-draw failure.
func _node_report(nodes: Array) -> String:
if nodes.is_empty():
return "NONE"
var n := nodes[0] as Node3D
if n == null:
return "not Node3D"
return "vis=%s pos=%s" % [n.is_visible_in_tree(), str(n.global_position.round())]
func _button_style(accent: Color) -> StyleBoxFlat:
var s := StyleBoxFlat.new()
s.bg_color = Color(0.10, 0.07, 0.03, 0.80)
s.set_corner_radius_all(18)
s.corner_detail = 6
s.set_border_width_all(3)
s.border_color = _ABILITY_ACCENT[slot]
s.border_color = accent
return s
# ── Menu button ──────────────────────────────────────────────────────────────
# Top-right "☰" — the touch stand-in for the keyboard's Esc-to-menu, so a phone
# player has a way out of a run.
func _build_menu_button() -> void:
var btn := Button.new()
btn.text = ""
btn.custom_minimum_size = Vector2(56.0, 56.0)
btn.focus_mode = Control.FOCUS_NONE
btn.anchor_left = 1.0
btn.anchor_right = 1.0
btn.grow_horizontal = Control.GROW_DIRECTION_BEGIN
btn.offset_left = -72.0
btn.offset_top = 16.0
btn.offset_right = -16.0
btn.offset_bottom = 72.0
var style := StyleBoxFlat.new()
style.bg_color = Color(0.10, 0.07, 0.03, 0.80)
style.set_corner_radius_all(12)
style.set_border_width_all(2)
style.border_color = Color(1.00, 0.78, 0.22, 0.8)
btn.add_theme_stylebox_override("normal", style)
btn.add_theme_stylebox_override("hover", style)
btn.add_theme_stylebox_override("pressed", style)
btn.add_theme_color_override("font_color", Color(1.00, 0.78, 0.22))
btn.add_theme_font_size_override("font_size", 28)
btn.pressed.connect(_return_to_menu)
_root.add_child(btn)
# ── Menu ──────────────────────────────────────────────────────────────────────
func _return_to_menu() -> void:
get_tree().paused = false
@@ -282,34 +487,26 @@ func _return_to_menu() -> void:
get_tree().change_scene_to_file("res://MainMenu.tscn")
# ── Layout & lifecycle ──────────────────────────────────────────────────────
# ── Lifecycle ─────────────────────────────────────────────────────────────────
func _relayout() -> void:
var vp := get_viewport().get_visible_rect().size
# Left half is the joystick zone; base radius scales with the shorter screen edge.
_stick.position = Vector2.ZERO
_stick.size = Vector2(vp.x * 0.5, vp.y)
_stick_radius = clampf(minf(vp.x, vp.y) * 0.16, 80.0, 150.0)
func _process(_delta: float) -> void:
var active := Controls.use_touch_ui()
# The game-over / pause screen owns the display when paused — stand down and drop
# any held movement so the bull doesn't coast on a stuck joystick.
if not active or get_tree().paused:
if _root.visible:
_root.visible = false
func _process(delta: float) -> void:
_hint_pulse = fmod(_hint_pulse + delta * 2.2, TAU)
var active := Controls.use_touch_ui() and not get_tree().paused
# The game-over / pause screen owns the display when paused — stand down and drop any
# held movement so the bull doesn't coast on a stuck joystick.
if not active:
if _surface.visible:
_surface.visible = false
if _stick_active:
_end_stick()
_touches.clear()
_touch_owner.clear()
_pinching = false
return
_root.visible = true
_surface.visible = true
if _player == null:
var players := get_tree().get_nodes_in_group(&"player")
if not players.is_empty():
_player = players[0]
return
for slot: int in _cd_overlays.size():
var fraction: float = _player.call(&"ability_cooldown_fraction", slot)
_cd_overlays[slot].anchor_top = 1.0 - clampf(fraction, 0.0, 1.0)
_surface.queue_redraw() # cooldown overlays animate every frame
+1
View File
@@ -0,0 +1 @@
uid://d4ky4pbu70bo3
+17
View File
@@ -57,6 +57,23 @@ static func badge(h_margin: float = 8.0, v_margin: float = 2.0) -> StyleBoxFlat:
return s
## Round token for the run map — a filled disc with an even border and the shared warm
## shadow. Unlike plaque()'s chiselled tablet the border is uniform, so it reads as a
## marker rather than a plate. A large corner radius clamps to a full circle on any pip
## size. Keeps map pips inside the single styling source instead of a hand-rolled box.
static func disc(fill: Color, border: Color, border_w: int = 3) -> StyleBoxFlat:
var s := StyleBoxFlat.new()
s.bg_color = fill
s.set_corner_radius_all(999)
s.corner_detail = 8
s.set_border_width_all(border_w)
s.border_color = border
s.shadow_color = SHADOW
s.shadow_size = 6
s.shadow_offset = Vector2(0.0, 3.0)
return s
## Thin gold rule for separating rows inside a plaque — brighter at the centre than
## the surrounding trim so it reads as an inlaid line.
static func rule() -> StyleBoxFlat: