Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c27897802a | ||
|
|
5feca5194d | ||
|
|
b80b4e1aab | ||
|
|
e41720c6ee | ||
|
|
1a4fd9b8ba |
Generated
+471
-11
@@ -200,9 +200,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "0348a1c054491f4bfe6ab86a7b6ab1e44e45d899005de92f58b3df180b36ddaf"
|
checksum = "0348a1c054491f4bfe6ab86a7b6ab1e44e45d899005de92f58b3df180b36ddaf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clipboard-win",
|
"clipboard-win",
|
||||||
|
"image",
|
||||||
"log",
|
"log",
|
||||||
"objc2 0.6.4",
|
"objc2 0.6.4",
|
||||||
"objc2-app-kit 0.3.2",
|
"objc2-app-kit 0.3.2",
|
||||||
|
"objc2-core-foundation",
|
||||||
|
"objc2-core-graphics",
|
||||||
"objc2-foundation 0.3.2",
|
"objc2-foundation 0.3.2",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
@@ -758,6 +761,54 @@ dependencies = [
|
|||||||
"syn 2.0.119",
|
"syn 2.0.119",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bevy_egui"
|
||||||
|
version = "0.42.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e99e2d018c7e567a268638d3058e57895e914e5650dcf7bd80a5fead9e6413a9"
|
||||||
|
dependencies = [
|
||||||
|
"arboard",
|
||||||
|
"bevy_app",
|
||||||
|
"bevy_asset",
|
||||||
|
"bevy_camera",
|
||||||
|
"bevy_color",
|
||||||
|
"bevy_core_pipeline",
|
||||||
|
"bevy_derive",
|
||||||
|
"bevy_ecs",
|
||||||
|
"bevy_image",
|
||||||
|
"bevy_input",
|
||||||
|
"bevy_log",
|
||||||
|
"bevy_math",
|
||||||
|
"bevy_mesh",
|
||||||
|
"bevy_picking",
|
||||||
|
"bevy_platform",
|
||||||
|
"bevy_reflect",
|
||||||
|
"bevy_render",
|
||||||
|
"bevy_shader",
|
||||||
|
"bevy_time",
|
||||||
|
"bevy_transform",
|
||||||
|
"bevy_ui_render",
|
||||||
|
"bevy_utils",
|
||||||
|
"bevy_window",
|
||||||
|
"bevy_winit",
|
||||||
|
"bytemuck",
|
||||||
|
"crossbeam-channel",
|
||||||
|
"egui",
|
||||||
|
"encase",
|
||||||
|
"getrandom 0.4.3",
|
||||||
|
"image",
|
||||||
|
"itertools 0.14.0",
|
||||||
|
"js-sys",
|
||||||
|
"smithay-clipboard",
|
||||||
|
"thread_local",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"wasm-bindgen-futures",
|
||||||
|
"web-sys",
|
||||||
|
"webbrowser",
|
||||||
|
"wgpu-types",
|
||||||
|
"winit",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bevy_encase_derive"
|
name = "bevy_encase_derive"
|
||||||
version = "0.19.1"
|
version = "0.19.1"
|
||||||
@@ -905,7 +956,7 @@ dependencies = [
|
|||||||
"bevy_world_serialization",
|
"bevy_world_serialization",
|
||||||
"fixedbitset",
|
"fixedbitset",
|
||||||
"gltf",
|
"gltf",
|
||||||
"itertools",
|
"itertools 0.14.0",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@@ -932,7 +983,7 @@ dependencies = [
|
|||||||
"bitflags 2.13.2",
|
"bitflags 2.13.2",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"futures-lite",
|
"futures-lite",
|
||||||
"guillotiere",
|
"guillotiere 0.6.2",
|
||||||
"half",
|
"half",
|
||||||
"image",
|
"image",
|
||||||
"ktx2",
|
"ktx2",
|
||||||
@@ -1138,7 +1189,7 @@ dependencies = [
|
|||||||
"bevy_reflect",
|
"bevy_reflect",
|
||||||
"derive_more",
|
"derive_more",
|
||||||
"glam",
|
"glam",
|
||||||
"itertools",
|
"itertools 0.14.0",
|
||||||
"libm",
|
"libm",
|
||||||
"rand",
|
"rand",
|
||||||
"rand_distr",
|
"rand_distr",
|
||||||
@@ -1382,7 +1433,7 @@ dependencies = [
|
|||||||
"glam",
|
"glam",
|
||||||
"image",
|
"image",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"itertools",
|
"itertools 0.14.0",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"naga",
|
"naga",
|
||||||
"nonmax",
|
"nonmax",
|
||||||
@@ -1944,18 +1995,43 @@ dependencies = [
|
|||||||
"thiserror 1.0.69",
|
"thiserror 1.0.69",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "calloop"
|
||||||
|
version = "0.14.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4dbf9978365bac10f54d1d4b04f7ce4427e51f71d61f2fe15e3fed5166474df7"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.13.2",
|
||||||
|
"polling",
|
||||||
|
"rustix 1.1.4",
|
||||||
|
"slab",
|
||||||
|
"tracing",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "calloop-wayland-source"
|
name = "calloop-wayland-source"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20"
|
checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"calloop",
|
"calloop 0.13.0",
|
||||||
"rustix 0.38.44",
|
"rustix 0.38.44",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "calloop-wayland-source"
|
||||||
|
version = "0.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa"
|
||||||
|
dependencies = [
|
||||||
|
"calloop 0.14.4",
|
||||||
|
"rustix 1.1.4",
|
||||||
|
"wayland-backend",
|
||||||
|
"wayland-client",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.4.6"
|
version = "1.4.6"
|
||||||
@@ -2028,6 +2104,15 @@ dependencies = [
|
|||||||
"unicode-width",
|
"unicode-width",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "color"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2ec7c5eb7a16992b1904d76c517d170ab353b0e0b3d5a0c81a8a0cd1037893cf"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "combine"
|
name = "combine"
|
||||||
version = "4.6.8"
|
version = "4.6.8"
|
||||||
@@ -2360,6 +2445,7 @@ name = "down_into_the_void"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bevy",
|
"bevy",
|
||||||
|
"bevy_egui",
|
||||||
"rand",
|
"rand",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2381,12 +2467,51 @@ version = "0.1.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76"
|
checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ecolor"
|
||||||
|
version = "0.36.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0656a7530b9e2841ee7a5f983965bdd9840c32f4012f759cfd44b912cced6b34"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
"emath",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "egui"
|
||||||
|
version = "0.36.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dc938cc27cd911415e1e4d151bc56ff9df063d8db081374e87aeb805ea74b2ba"
|
||||||
|
dependencies = [
|
||||||
|
"accesskit",
|
||||||
|
"ahash",
|
||||||
|
"bitflags 2.13.2",
|
||||||
|
"emath",
|
||||||
|
"epaint",
|
||||||
|
"itertools 0.15.0",
|
||||||
|
"log",
|
||||||
|
"nohash-hasher",
|
||||||
|
"profiling",
|
||||||
|
"smallvec",
|
||||||
|
"unicode-segmentation",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "either"
|
name = "either"
|
||||||
version = "1.18.0"
|
version = "1.18.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
|
checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "emath"
|
||||||
|
version = "0.36.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "52c8d4141cf0f60fb2f7aefaf352d3ffa5171ef0ab09731c64391801e95e48f1"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "encase"
|
name = "encase"
|
||||||
version = "0.12.1"
|
version = "0.12.1"
|
||||||
@@ -2418,6 +2543,37 @@ dependencies = [
|
|||||||
"syn 2.0.119",
|
"syn 2.0.119",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "epaint"
|
||||||
|
version = "0.36.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a0ec0308dc23130fc1a7d4623a8534c2ed069c6dc84e258ee4f3de99615aa1a3"
|
||||||
|
dependencies = [
|
||||||
|
"ahash",
|
||||||
|
"bytemuck",
|
||||||
|
"ecolor",
|
||||||
|
"emath",
|
||||||
|
"epaint_default_fonts",
|
||||||
|
"font-types 0.12.5",
|
||||||
|
"harfrust 0.12.0",
|
||||||
|
"log",
|
||||||
|
"nohash-hasher",
|
||||||
|
"parking_lot",
|
||||||
|
"profiling",
|
||||||
|
"self_cell",
|
||||||
|
"skrifa 0.44.0",
|
||||||
|
"smallvec",
|
||||||
|
"unicode-general-category",
|
||||||
|
"unicode-segmentation",
|
||||||
|
"vello_cpu",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "epaint_default_fonts"
|
||||||
|
version = "0.36.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "773fa9c96dd0dbef887e39d0ed6177f141cce4d68e6041df77570aa3702dfa13"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "equivalent"
|
name = "equivalent"
|
||||||
version = "1.0.2"
|
version = "1.0.2"
|
||||||
@@ -2486,6 +2642,12 @@ version = "2.5.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
|
checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "fax"
|
||||||
|
version = "0.2.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fdeflate"
|
name = "fdeflate"
|
||||||
version = "0.3.7"
|
version = "0.3.7"
|
||||||
@@ -2495,6 +2657,12 @@ dependencies = [
|
|||||||
"simd-adler32",
|
"simd-adler32",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "fearless_simd"
|
||||||
|
version = "0.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b97b65636e5b9ef369943878ac74335ba1c55c1cb6adbf1e2c293c624248d693"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "find-msvc-tools"
|
name = "find-msvc-tools"
|
||||||
version = "0.1.12"
|
version = "0.1.12"
|
||||||
@@ -2595,6 +2763,15 @@ version = "0.3.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
|
checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "form_urlencoded"
|
||||||
|
version = "1.2.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
|
||||||
|
dependencies = [
|
||||||
|
"percent-encoding",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-channel"
|
name = "futures-channel"
|
||||||
version = "0.3.34"
|
version = "0.3.34"
|
||||||
@@ -2688,9 +2865,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
|
checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
"js-sys",
|
||||||
"libc",
|
"libc",
|
||||||
"r-efi 6.0.0",
|
"r-efi 6.0.0",
|
||||||
"rand_core",
|
"rand_core",
|
||||||
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2751,6 +2930,22 @@ dependencies = [
|
|||||||
"serde_core",
|
"serde_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "glifo"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ed4a1bb24121291d27230c1b1b44e07d6a9b28cefdb32fe1581dfb84e14f940a"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
"foldhash 0.2.0",
|
||||||
|
"hashbrown 0.17.1",
|
||||||
|
"log",
|
||||||
|
"peniko",
|
||||||
|
"skrifa 0.44.0",
|
||||||
|
"smallvec",
|
||||||
|
"vello_common",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glow"
|
name = "glow"
|
||||||
version = "0.17.0"
|
version = "0.17.0"
|
||||||
@@ -2858,6 +3053,15 @@ dependencies = [
|
|||||||
"svg_fmt",
|
"svg_fmt",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "guillotiere"
|
||||||
|
version = "0.7.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6b17e70c989c36bad147b27a58d148c0741c51448aa5653436547323e524d0ab"
|
||||||
|
dependencies = [
|
||||||
|
"euclid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "half"
|
name = "half"
|
||||||
version = "2.7.1"
|
version = "2.7.1"
|
||||||
@@ -2884,6 +3088,18 @@ dependencies = [
|
|||||||
"smallvec",
|
"smallvec",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "harfrust"
|
||||||
|
version = "0.12.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c03d949a14aa089bbb282f7dd76a498a7f684428e4257202efc119ec010376f9"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.13.2",
|
||||||
|
"bytemuck",
|
||||||
|
"read-fonts 0.41.0",
|
||||||
|
"smallvec",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hash32"
|
name = "hash32"
|
||||||
version = "0.3.1"
|
version = "0.3.1"
|
||||||
@@ -3086,6 +3302,27 @@ version = "2.3.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ae293c039020f9ec10710af98d29ce6aa2051486638b49c9a6409f3b4a9e98ad"
|
checksum = "ae293c039020f9ec10710af98d29ce6aa2051486638b49c9a6409f3b4a9e98ad"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "idna"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
|
||||||
|
dependencies = [
|
||||||
|
"idna_adapter",
|
||||||
|
"smallvec",
|
||||||
|
"utf8_iter",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "idna_adapter"
|
||||||
|
version = "1.2.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
|
||||||
|
dependencies = [
|
||||||
|
"icu_normalizer",
|
||||||
|
"icu_properties",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "image"
|
name = "image"
|
||||||
version = "0.25.10"
|
version = "0.25.10"
|
||||||
@@ -3097,6 +3334,7 @@ dependencies = [
|
|||||||
"moxcms",
|
"moxcms",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"png",
|
"png",
|
||||||
|
"tiff",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3155,6 +3393,15 @@ dependencies = [
|
|||||||
"either",
|
"either",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itertools"
|
||||||
|
version = "0.15.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc"
|
||||||
|
dependencies = [
|
||||||
|
"either",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "1.0.18"
|
version = "1.0.18"
|
||||||
@@ -3282,6 +3529,18 @@ dependencies = [
|
|||||||
"bitflags 2.13.2",
|
"bitflags 2.13.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "kurbo"
|
||||||
|
version = "0.13.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4b60dfc32f652b926df6192e55525b16d186c69d47876c3ead4da5cc9f8450e2"
|
||||||
|
dependencies = [
|
||||||
|
"arrayvec",
|
||||||
|
"euclid",
|
||||||
|
"polycool",
|
||||||
|
"smallvec",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lazy_static"
|
name = "lazy_static"
|
||||||
version = "1.5.0"
|
version = "1.5.0"
|
||||||
@@ -3537,6 +3796,12 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nohash-hasher"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nom"
|
name = "nom"
|
||||||
version = "8.0.0"
|
version = "8.0.0"
|
||||||
@@ -4106,7 +4371,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "8fad031076f48f0d4d85ce1aea9b94b4e715a4d636a030a123038f8f5b5e4343"
|
checksum = "8fad031076f48f0d4d85ce1aea9b94b4e715a4d636a030a123038f8f5b5e4343"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fontique",
|
"fontique",
|
||||||
"harfrust",
|
"harfrust 0.6.2",
|
||||||
"hashbrown 0.17.1",
|
"hashbrown 0.17.1",
|
||||||
"icu_normalizer",
|
"icu_normalizer",
|
||||||
"icu_properties",
|
"icu_properties",
|
||||||
@@ -4126,6 +4391,19 @@ dependencies = [
|
|||||||
"icu_properties",
|
"icu_properties",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "peniko"
|
||||||
|
version = "0.6.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "839c8299360d2e998bdb106dc0a6cd71dcc5f4df51df1b620361bf50e283cca6"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
"color",
|
||||||
|
"kurbo",
|
||||||
|
"linebender_resource_handle",
|
||||||
|
"smallvec",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "percent-encoding"
|
name = "percent-encoding"
|
||||||
version = "2.3.2"
|
version = "2.3.2"
|
||||||
@@ -4221,6 +4499,15 @@ dependencies = [
|
|||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "polycool"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "50596ddc09eb5ad5f75cacd40209568e66df71baf86e1499a0e99c4cff12a5a6"
|
||||||
|
dependencies = [
|
||||||
|
"arrayvec",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "portable-atomic"
|
name = "portable-atomic"
|
||||||
version = "1.15.0"
|
version = "1.15.0"
|
||||||
@@ -4292,6 +4579,12 @@ version = "0.1.30"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea"
|
checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quick-error"
|
||||||
|
version = "2.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quick-xml"
|
name = "quick-xml"
|
||||||
version = "0.41.0"
|
version = "0.41.0"
|
||||||
@@ -4582,10 +4875,16 @@ dependencies = [
|
|||||||
"ab_glyph",
|
"ab_glyph",
|
||||||
"log",
|
"log",
|
||||||
"memmap2",
|
"memmap2",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit 0.19.2",
|
||||||
"tiny-skia",
|
"tiny-skia",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "self_cell"
|
||||||
|
version = "1.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2ab42ca02749e120097e328d91d415325bdf43b1c72c4c8badf37375fe40a813"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver"
|
name = "semver"
|
||||||
version = "1.0.28"
|
version = "1.0.28"
|
||||||
@@ -4726,8 +5025,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016"
|
checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.13.2",
|
"bitflags 2.13.2",
|
||||||
"calloop",
|
"calloop 0.13.0",
|
||||||
"calloop-wayland-source",
|
"calloop-wayland-source 0.3.0",
|
||||||
"cursor-icon",
|
"cursor-icon",
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
@@ -4744,6 +5043,44 @@ dependencies = [
|
|||||||
"xkeysym",
|
"xkeysym",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "smithay-client-toolkit"
|
||||||
|
version = "0.20.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0512da38f5e2b31201a93524adb8d3136276fa4fe4aafab4e1f727a82b534cc0"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.13.2",
|
||||||
|
"calloop 0.14.4",
|
||||||
|
"calloop-wayland-source 0.4.1",
|
||||||
|
"cursor-icon",
|
||||||
|
"libc",
|
||||||
|
"log",
|
||||||
|
"memmap2",
|
||||||
|
"rustix 1.1.4",
|
||||||
|
"thiserror 2.0.20",
|
||||||
|
"wayland-backend",
|
||||||
|
"wayland-client",
|
||||||
|
"wayland-csd-frame",
|
||||||
|
"wayland-cursor",
|
||||||
|
"wayland-protocols",
|
||||||
|
"wayland-protocols-experimental",
|
||||||
|
"wayland-protocols-misc",
|
||||||
|
"wayland-protocols-wlr",
|
||||||
|
"wayland-scanner",
|
||||||
|
"xkeysym",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "smithay-clipboard"
|
||||||
|
version = "0.7.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "71704c03f739f7745053bde45fa203a46c58d25bc5c4efba1d9a60e9dba81226"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"smithay-client-toolkit 0.20.0",
|
||||||
|
"wayland-backend",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smol_str"
|
name = "smol_str"
|
||||||
version = "0.2.2"
|
version = "0.2.2"
|
||||||
@@ -4941,6 +5278,20 @@ dependencies = [
|
|||||||
"cfg-if",
|
"cfg-if",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tiff"
|
||||||
|
version = "0.11.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52"
|
||||||
|
dependencies = [
|
||||||
|
"fax",
|
||||||
|
"flate2",
|
||||||
|
"half",
|
||||||
|
"quick-error",
|
||||||
|
"weezl",
|
||||||
|
"zune-jpeg",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tiny-skia"
|
name = "tiny-skia"
|
||||||
version = "0.11.4"
|
version = "0.11.4"
|
||||||
@@ -5019,6 +5370,7 @@ version = "0.1.44"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
|
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"log",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"tracing-attributes",
|
"tracing-attributes",
|
||||||
"tracing-core",
|
"tracing-core",
|
||||||
@@ -5132,6 +5484,12 @@ version = "1.15.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "214ca0b2191785cbc06209b9ca1861e048e39b5ba33574b3cedd58363d5bb5f6"
|
checksum = "214ca0b2191785cbc06209b9ca1861e048e39b5ba33574b3cedd58363d5bb5f6"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-general-category"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0b993bddc193ae5bd0d623b49ec06ac3e9312875fdae725a975c51db1cc1677f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.24"
|
version = "1.0.24"
|
||||||
@@ -5156,6 +5514,18 @@ version = "0.2.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
|
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "url"
|
||||||
|
version = "2.5.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
|
||||||
|
dependencies = [
|
||||||
|
"form_urlencoded",
|
||||||
|
"idna",
|
||||||
|
"percent-encoding",
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "utf8_iter"
|
name = "utf8_iter"
|
||||||
version = "1.0.4"
|
version = "1.0.4"
|
||||||
@@ -5197,6 +5567,33 @@ version = "0.8.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
|
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "vello_common"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b2e9aed918117e8152c9eddfd8362d73c465c23f26c44786aa331707b8a64fa2"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
"fearless_simd",
|
||||||
|
"guillotiere 0.7.0",
|
||||||
|
"log",
|
||||||
|
"peniko",
|
||||||
|
"smallvec",
|
||||||
|
"thiserror 2.0.20",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "vello_cpu"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ac7349e1f55f6b801c7c277958df4ea53e7f20f21e8014910ad888b2ecda93ea"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
"glifo",
|
||||||
|
"hashbrown 0.17.1",
|
||||||
|
"vello_common",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "version_check"
|
name = "version_check"
|
||||||
version = "0.9.5"
|
version = "0.9.5"
|
||||||
@@ -5337,6 +5734,32 @@ dependencies = [
|
|||||||
"wayland-scanner",
|
"wayland-scanner",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wayland-protocols-experimental"
|
||||||
|
version = "20250721.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "40a1f863128dcaaec790d7b4b396cc9b9a7a079e878e18c47e6c2d2c5a8dcbb1"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.13.2",
|
||||||
|
"wayland-backend",
|
||||||
|
"wayland-client",
|
||||||
|
"wayland-protocols",
|
||||||
|
"wayland-scanner",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wayland-protocols-misc"
|
||||||
|
version = "0.3.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6e9567599ef23e09b8dad6e429e5738d4509dfc46b3b21f32841a304d16b29c8"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.13.2",
|
||||||
|
"wayland-backend",
|
||||||
|
"wayland-client",
|
||||||
|
"wayland-protocols",
|
||||||
|
"wayland-scanner",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-protocols-plasma"
|
name = "wayland-protocols-plasma"
|
||||||
version = "0.3.12"
|
version = "0.3.12"
|
||||||
@@ -5424,6 +5847,28 @@ dependencies = [
|
|||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "webbrowser"
|
||||||
|
version = "1.2.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "62c35be770821a214dbc362fc26908c853e776c0004294d0b10b8a6bad582f94"
|
||||||
|
dependencies = [
|
||||||
|
"jni 0.22.4",
|
||||||
|
"log",
|
||||||
|
"ndk-context",
|
||||||
|
"objc2 0.6.4",
|
||||||
|
"objc2-app-kit 0.3.2",
|
||||||
|
"objc2-foundation 0.3.2",
|
||||||
|
"url",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "weezl"
|
||||||
|
version = "0.1.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu"
|
name = "wgpu"
|
||||||
version = "29.0.4"
|
version = "29.0.4"
|
||||||
@@ -5975,7 +6420,7 @@ dependencies = [
|
|||||||
"bitflags 2.13.2",
|
"bitflags 2.13.2",
|
||||||
"block2 0.5.1",
|
"block2 0.5.1",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"calloop",
|
"calloop 0.13.0",
|
||||||
"cfg_aliases",
|
"cfg_aliases",
|
||||||
"concurrent-queue",
|
"concurrent-queue",
|
||||||
"core-foundation",
|
"core-foundation",
|
||||||
@@ -5997,7 +6442,7 @@ dependencies = [
|
|||||||
"redox_syscall 0.4.1",
|
"redox_syscall 0.4.1",
|
||||||
"rustix 0.38.44",
|
"rustix 0.38.44",
|
||||||
"sctk-adwaita",
|
"sctk-adwaita",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit 0.19.2",
|
||||||
"smol_str",
|
"smol_str",
|
||||||
"tracing",
|
"tracing",
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
@@ -6239,3 +6684,18 @@ name = "zmij"
|
|||||||
version = "1.0.23"
|
version = "1.0.23"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zune-core"
|
||||||
|
version = "0.5.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zune-jpeg"
|
||||||
|
version = "0.5.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296"
|
||||||
|
dependencies = [
|
||||||
|
"zune-core",
|
||||||
|
]
|
||||||
|
|||||||
@@ -5,4 +5,5 @@ edition = "2024"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bevy = "0.19.1"
|
bevy = "0.19.1"
|
||||||
|
bevy_egui = "0.42.0"
|
||||||
rand = "0.10.2"
|
rand = "0.10.2"
|
||||||
|
|||||||
+7
-2
@@ -21,11 +21,16 @@ pub const MARGIN_BELLOW: f32 = 400.0;
|
|||||||
// Player
|
// Player
|
||||||
pub const PLAYER_HITBOX: Vec2 = Vec2::new(20.0, 40.0);
|
pub const PLAYER_HITBOX: Vec2 = Vec2::new(20.0, 40.0);
|
||||||
pub const FALL_SPEED: f32 = 500.0;
|
pub const FALL_SPEED: f32 = 500.0;
|
||||||
pub const DIVE_SPEED: f32 = 2700.0;
|
pub const DIVE_SPEED: f32 = 2000.0;
|
||||||
pub const HORIZONTAL_SPEED: f32 = 450.0;
|
pub const HORIZONTAL_SPEED: f32 = 400.0;
|
||||||
pub const START_POSITION: Vec3 = Vec3::new(0.0, 0.0, 2.0);
|
pub const START_POSITION: Vec3 = Vec3::new(0.0, 0.0, 2.0);
|
||||||
pub const CAMERAE_OFFSET: f32 = 280.0;
|
pub const CAMERAE_OFFSET: f32 = 280.0;
|
||||||
|
|
||||||
|
// Movement intertia
|
||||||
|
pub const HORIZONTAL_ACCEL: f32 = 2600.0;
|
||||||
|
pub const HORIZONTAL_FRICTION: f32 = 1800.0;
|
||||||
|
pub const VERTICAL_RATE: f32 = 4000.0;
|
||||||
|
|
||||||
// Validator
|
// Validator
|
||||||
pub const INERTIA_MARGIN: f32 = 4.0;
|
pub const INERTIA_MARGIN: f32 = 4.0;
|
||||||
pub const DESIGN_LATERAL_SPEED_RATIO: f32 = 0.6;
|
pub const DESIGN_LATERAL_SPEED_RATIO: f32 = 0.6;
|
||||||
|
|||||||
+34
-1
@@ -2,10 +2,14 @@ use bevy::{
|
|||||||
diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin},
|
diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
};
|
};
|
||||||
|
use bevy_egui::{EguiContexts, EguiPrimaryContextPass, egui};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
config::{SCREEN_HEIGHT, SCREEN_WIDTH},
|
config::{SCREEN_HEIGHT, SCREEN_WIDTH},
|
||||||
gameplay::{camera::MainCamera, player::Player},
|
gameplay::{
|
||||||
|
camera::MainCamera,
|
||||||
|
player::{MoveSettings, Player},
|
||||||
|
},
|
||||||
states::GameState,
|
states::GameState,
|
||||||
world::RunSeed,
|
world::RunSeed,
|
||||||
};
|
};
|
||||||
@@ -202,6 +206,31 @@ fn update_view_debug_text(mut text: Single<&mut Text, With<ViewDebugText>>) {
|
|||||||
text.0 = format!("View: {SCREEN_WIDTH:.0}x{SCREEN_HEIGHT:.0}");
|
text.0 = format!("View: {SCREEN_WIDTH:.0}x{SCREEN_HEIGHT:.0}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Real time tuning movement & inertia sliders
|
||||||
|
fn move_tuning_panel(mut contexts: EguiContexts, mut settings: ResMut<MoveSettings>) {
|
||||||
|
egui::Window::new("Movement / Inertia ").show(
|
||||||
|
contexts.ctx_mut().expect("egui context missing"),
|
||||||
|
|ui| {
|
||||||
|
ui.add(
|
||||||
|
egui::Slider::new(&mut settings.horizontal_speed, 0.0..=1000.0).text("Max speed"),
|
||||||
|
);
|
||||||
|
ui.add(
|
||||||
|
egui::Slider::new(&mut settings.horizontal_accel, 0.0..=10000.0)
|
||||||
|
.text("Acceleration"),
|
||||||
|
);
|
||||||
|
ui.add(
|
||||||
|
egui::Slider::new(&mut settings.horizontal_friction, 0.0..=10000.0)
|
||||||
|
.text("Friction"),
|
||||||
|
);
|
||||||
|
ui.add(egui::Slider::new(&mut settings.fall_speed, 0.0..=2000.0).text("Fall"));
|
||||||
|
ui.add(egui::Slider::new(&mut settings.dive_speed, 0.0..=5000.0).text("SpeeFall"));
|
||||||
|
ui.add(
|
||||||
|
egui::Slider::new(&mut settings.vertical_rate, 0.0..=10000.0).text("Vertical rate"),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
pub struct DebugPlugin;
|
pub struct DebugPlugin;
|
||||||
|
|
||||||
impl Plugin for DebugPlugin {
|
impl Plugin for DebugPlugin {
|
||||||
@@ -227,6 +256,10 @@ impl Plugin for DebugPlugin {
|
|||||||
)
|
)
|
||||||
.run_if(in_state(GameState::InGame)),
|
.run_if(in_state(GameState::InGame)),
|
||||||
)
|
)
|
||||||
|
.add_systems(
|
||||||
|
EguiPrimaryContextPass,
|
||||||
|
move_tuning_panel.run_if(in_state(GameState::InGame)),
|
||||||
|
)
|
||||||
.add_plugins(FrameTimeDiagnosticsPlugin::default())
|
.add_plugins(FrameTimeDiagnosticsPlugin::default())
|
||||||
.add_systems(OnExit(GameState::InGame), cleanup_debug);
|
.add_systems(OnExit(GameState::InGame), cleanup_debug);
|
||||||
}
|
}
|
||||||
|
|||||||
+57
-13
@@ -2,9 +2,12 @@ use bevy::prelude::*;
|
|||||||
|
|
||||||
use crate::config::DIVE_SPEED;
|
use crate::config::DIVE_SPEED;
|
||||||
use crate::config::FALL_SPEED;
|
use crate::config::FALL_SPEED;
|
||||||
|
use crate::config::HORIZONTAL_ACCEL;
|
||||||
|
use crate::config::HORIZONTAL_FRICTION;
|
||||||
use crate::config::HORIZONTAL_SPEED;
|
use crate::config::HORIZONTAL_SPEED;
|
||||||
use crate::config::PLAYER_HITBOX;
|
use crate::config::PLAYER_HITBOX;
|
||||||
use crate::config::START_POSITION;
|
use crate::config::START_POSITION;
|
||||||
|
use crate::config::VERTICAL_RATE;
|
||||||
use crate::gameplay::collision::Collider;
|
use crate::gameplay::collision::Collider;
|
||||||
use crate::gameplay::collision::check_collision_with_player;
|
use crate::gameplay::collision::check_collision_with_player;
|
||||||
use crate::states::GameState;
|
use crate::states::GameState;
|
||||||
@@ -34,9 +37,43 @@ fn spawn_player(mut commands: Commands) {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Move value to target by max_step
|
||||||
|
fn approach(value: f32, target: f32, max_step: f32) -> f32 {
|
||||||
|
if value < target {
|
||||||
|
(value + max_step).min(target)
|
||||||
|
} else {
|
||||||
|
(value - max_step).max(target)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// For debug
|
||||||
|
#[derive(Resource)]
|
||||||
|
pub struct MoveSettings {
|
||||||
|
pub horizontal_speed: f32,
|
||||||
|
pub horizontal_accel: f32,
|
||||||
|
pub horizontal_friction: f32,
|
||||||
|
pub fall_speed: f32,
|
||||||
|
pub dive_speed: f32,
|
||||||
|
pub vertical_rate: f32,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for MoveSettings {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
horizontal_speed: HORIZONTAL_SPEED,
|
||||||
|
horizontal_accel: HORIZONTAL_ACCEL,
|
||||||
|
horizontal_friction: HORIZONTAL_FRICTION,
|
||||||
|
fall_speed: FALL_SPEED,
|
||||||
|
dive_speed: DIVE_SPEED,
|
||||||
|
vertical_rate: VERTICAL_RATE,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Input + movement system for the player
|
// Input + movement system for the player
|
||||||
pub(crate) fn move_player(
|
pub(crate) fn move_player(
|
||||||
input: Res<ButtonInput<KeyCode>>,
|
input: Res<ButtonInput<KeyCode>>,
|
||||||
|
settings: Res<MoveSettings>,
|
||||||
time: Res<Time>,
|
time: Res<Time>,
|
||||||
mut player: Query<(&mut Velocity, &mut Transform), With<Player>>,
|
mut player: Query<(&mut Velocity, &mut Transform), With<Player>>,
|
||||||
mut fall_started: ResMut<FallStarted>,
|
mut fall_started: ResMut<FallStarted>,
|
||||||
@@ -66,21 +103,27 @@ pub(crate) fn move_player(
|
|||||||
0.0
|
0.0
|
||||||
};
|
};
|
||||||
|
|
||||||
// let facteur = 1.0 - (-RATE * time.delta_secs()).exp();
|
let dt = time.delta_secs();
|
||||||
let target = Vec2::new(
|
|
||||||
direction * HORIZONTAL_SPEED,
|
// Inertia
|
||||||
-if input.pressed(KeyCode::KeyS) {
|
if direction != 0.0 {
|
||||||
DIVE_SPEED
|
velocity.0.x = approach(
|
||||||
} else {
|
velocity.0.x,
|
||||||
FALL_SPEED
|
direction * settings.horizontal_speed,
|
||||||
},
|
settings.horizontal_accel * dt,
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
velocity.0.x = approach(velocity.0.x, 0.0, settings.horizontal_friction * dt);
|
||||||
|
}
|
||||||
|
let vertical_target = if input.pressed(KeyCode::KeyS) {
|
||||||
|
-settings.dive_speed
|
||||||
|
} else {
|
||||||
|
-settings.fall_speed
|
||||||
|
};
|
||||||
|
velocity.0.y = approach(velocity.0.y, vertical_target, settings.vertical_rate * dt);
|
||||||
|
|
||||||
// velocity.0 = velocity.0.lerp(target, facteur);
|
// Position update
|
||||||
velocity.0 = target;
|
transform.translation += velocity.0.extend(0.0) * dt;
|
||||||
|
|
||||||
// Position update (no smoothness in velocity)
|
|
||||||
transform.translation += velocity.0.extend(0.0) * time.delta_secs();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
@@ -119,6 +162,7 @@ impl Plugin for PlayerPlugin {
|
|||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
app.add_systems(OnEnter(GameState::InGame), (spawn_player, start_run))
|
app.add_systems(OnEnter(GameState::InGame), (spawn_player, start_run))
|
||||||
.init_resource::<FallStarted>()
|
.init_resource::<FallStarted>()
|
||||||
|
.init_resource::<MoveSettings>()
|
||||||
.add_systems(
|
.add_systems(
|
||||||
Update,
|
Update,
|
||||||
(
|
(
|
||||||
|
|||||||
+8
-1
@@ -1,5 +1,7 @@
|
|||||||
use bevy::{prelude::*, window::PresentMode};
|
use bevy::{prelude::*, window::PresentMode};
|
||||||
|
|
||||||
|
use bevy_egui::{EguiGlobalSettings, EguiPlugin};
|
||||||
|
|
||||||
use crate::config::{SCREEN_HEIGHT, SCREEN_WIDTH};
|
use crate::config::{SCREEN_HEIGHT, SCREEN_WIDTH};
|
||||||
use crate::debug::DebugPlugin;
|
use crate::debug::DebugPlugin;
|
||||||
use crate::gameplay::bounds::BoundsPlugin;
|
use crate::gameplay::bounds::BoundsPlugin;
|
||||||
@@ -43,9 +45,14 @@ fn main() {
|
|||||||
.add_plugins(BoundsPlugin) // Bound player
|
.add_plugins(BoundsPlugin) // Bound player
|
||||||
.add_plugins(ScorePlugin) // Score
|
.add_plugins(ScorePlugin) // Score
|
||||||
.add_plugins(WorldPlugin) // Chunk logic
|
.add_plugins(WorldPlugin) // Chunk logic
|
||||||
.add_plugins(DebugPlugin) // Debug
|
|
||||||
.add_plugins(GameStatePlugin) // Game states
|
.add_plugins(GameStatePlugin) // Game states
|
||||||
.add_plugins(MainMenuPlugin) // Main Menu
|
.add_plugins(MainMenuPlugin) // Main Menu
|
||||||
.add_plugins(GameOverPlugin) // GameOver
|
.add_plugins(GameOverPlugin) // GameOver
|
||||||
|
.insert_resource(EguiGlobalSettings {
|
||||||
|
auto_create_primary_context: false,
|
||||||
|
..default()
|
||||||
|
})
|
||||||
|
.add_plugins(EguiPlugin::default()) // Debug UI
|
||||||
|
.add_plugins(DebugPlugin) // Debug
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ use bevy::camera::RenderTarget;
|
|||||||
use bevy::camera::visibility::RenderLayers;
|
use bevy::camera::visibility::RenderLayers;
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy::render::render_resource::TextureFormat;
|
use bevy::render::render_resource::TextureFormat;
|
||||||
|
use bevy_egui::PrimaryEguiContext;
|
||||||
|
|
||||||
use crate::config::{SCREEN_ASPECT, SCREEN_HEIGHT, SCREEN_WIDTH};
|
use crate::config::{SCREEN_ASPECT, SCREEN_HEIGHT, SCREEN_WIDTH};
|
||||||
use crate::gameplay::camera::MainCamera;
|
use crate::gameplay::camera::MainCamera;
|
||||||
@@ -34,6 +35,7 @@ fn spawn_virtual_screen(mut commands: Commands, mut images: ResMut<Assets<Image>
|
|||||||
|
|
||||||
commands.spawn((
|
commands.spawn((
|
||||||
DisplayScreen,
|
DisplayScreen,
|
||||||
|
PrimaryEguiContext, // egui render over
|
||||||
Camera2d,
|
Camera2d,
|
||||||
Camera {
|
Camera {
|
||||||
order: 0,
|
order: 0,
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
use bevy::prelude::*;
|
|
||||||
|
|
||||||
use crate::{config::TERRAIN_COLS, world::rng::SplitMix64, world::rng::derive};
|
use crate::{config::TERRAIN_COLS, world::rng::SplitMix64, world::rng::derive};
|
||||||
|
|
||||||
const SALT_DOOR: u64 = 1;
|
const SALT_DOOR: u64 = 1;
|
||||||
|
|||||||
@@ -1,335 +0,0 @@
|
|||||||
use crate::{
|
|
||||||
config::TERRAIN_COLS,
|
|
||||||
world::{
|
|
||||||
doors::{Door, door},
|
|
||||||
grid::GridRect,
|
|
||||||
rng::{SplitMix64, derive},
|
|
||||||
validator::validate,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const SALT_WALLS: u64 = 2;
|
|
||||||
const SALT_VARIANT: u64 = 3;
|
|
||||||
|
|
||||||
const MIN_WALLS: i32 = 3;
|
|
||||||
const MAX_WALLS: i32 = 5;
|
|
||||||
const MAX_ATTEMPTS: i32 = 16;
|
|
||||||
const FIRST_WALL_ROW: i32 = 26;
|
|
||||||
const MIN_BOTTOM_ROW: i32 = 4;
|
|
||||||
const HOLE_MIN_WIDTH: i32 = 2;
|
|
||||||
const HOLE_MAX_WIDTH: i32 = 10;
|
|
||||||
const SECOND_HOLE_GAP: i32 = 2;
|
|
||||||
const THICK_HEIGHT: i32 = 2;
|
|
||||||
|
|
||||||
const GAP_VARIANTS: u64 = 4;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
||||||
enum GapVariant {
|
|
||||||
Classic,
|
|
||||||
Double,
|
|
||||||
Thick,
|
|
||||||
Staircase,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
||||||
pub struct ChunkData {
|
|
||||||
pub rects: Vec<GridRect>,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn generate_chunk(seed: u64, depth: i64) -> ChunkData {
|
|
||||||
match try_generate(seed, depth) {
|
|
||||||
Some(chunk) => chunk,
|
|
||||||
None => fallback_chunk(seed, depth),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn try_generate(seed: u64, depth: i64) -> Option<ChunkData> {
|
|
||||||
let bottom_door = door(seed, depth)?;
|
|
||||||
let top_door = door(seed, depth - 1)?;
|
|
||||||
let v = gap_variant(seed, depth);
|
|
||||||
|
|
||||||
let mut rng = SplitMix64::new(derive(seed, depth, SALT_WALLS));
|
|
||||||
|
|
||||||
for _ in 0..MAX_ATTEMPTS {
|
|
||||||
let n_walls = MIN_WALLS + (rng.next_u64() % ((MAX_WALLS - MIN_WALLS + 1) as u64)) as i32;
|
|
||||||
let rects = build_gapwalls(v, top_door, bottom_door, n_walls, &mut rng);
|
|
||||||
if validate(&rects, bottom_door, top_door) {
|
|
||||||
return Some(ChunkData { rects });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
None
|
|
||||||
}
|
|
||||||
|
|
||||||
fn gap_variant(seed: u64, depth: i64) -> GapVariant {
|
|
||||||
match derive(seed, depth, SALT_VARIANT) % GAP_VARIANTS {
|
|
||||||
1 => GapVariant::Double,
|
|
||||||
2 => GapVariant::Thick,
|
|
||||||
3 => GapVariant::Staircase,
|
|
||||||
_ => GapVariant::Classic,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn build_gapwalls(
|
|
||||||
v: GapVariant,
|
|
||||||
top: Door,
|
|
||||||
bottom: Door,
|
|
||||||
n_walls: i32,
|
|
||||||
rng: &mut SplitMix64,
|
|
||||||
) -> Vec<GridRect> {
|
|
||||||
match v {
|
|
||||||
GapVariant::Classic => classic(top, bottom, n_walls, rng),
|
|
||||||
GapVariant::Double => double(top, bottom, n_walls, rng),
|
|
||||||
GapVariant::Thick => thick(top, bottom, n_walls, rng),
|
|
||||||
GapVariant::Staircase => staircase(top, bottom, n_walls),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn classic(top: Door, bottom: Door, n_walls: i32, rng: &mut SplitMix64) -> Vec<GridRect> {
|
|
||||||
let (t, b) = centers(top, bottom);
|
|
||||||
let mut rects = Vec::new();
|
|
||||||
|
|
||||||
for i in 0..n_walls {
|
|
||||||
let mut c = lerp(t, b, i, n_walls);
|
|
||||||
if i < n_walls - 1 {
|
|
||||||
c += jitter(rng);
|
|
||||||
}
|
|
||||||
let h = hole(c, width(bottom, n_walls, i));
|
|
||||||
emit(&mut rects, wall_row(i, n_walls), 1, &[h]);
|
|
||||||
}
|
|
||||||
rects
|
|
||||||
}
|
|
||||||
|
|
||||||
fn double(top: Door, bottom: Door, n_walls: i32, rng: &mut SplitMix64) -> Vec<GridRect> {
|
|
||||||
let (t, b) = centers(top, bottom);
|
|
||||||
let mut rects = Vec::new();
|
|
||||||
|
|
||||||
for i in 0..n_walls {
|
|
||||||
let mut c = lerp(t, b, i, n_walls);
|
|
||||||
if i < n_walls - 1 {
|
|
||||||
c += jitter(rng);
|
|
||||||
}
|
|
||||||
let main = hole(c, width(bottom, n_walls, i));
|
|
||||||
|
|
||||||
// Narrow risky hole, SECOND_HOLE_GAP columns of wall away
|
|
||||||
let side = (rng.next_u64() % 2) as i32 * 2 - 1; // -1 or +1
|
|
||||||
let (sec_min, sec_max) = if side < 0 {
|
|
||||||
(main.0 - SECOND_HOLE_GAP - 1, main.0 - SECOND_HOLE_GAP)
|
|
||||||
} else {
|
|
||||||
(main.1 + SECOND_HOLE_GAP, main.1 + SECOND_HOLE_GAP + 1)
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut holes = vec![main];
|
|
||||||
if side < 0 {
|
|
||||||
if sec_min >= 0 {
|
|
||||||
holes.insert(0, (sec_min, sec_max));
|
|
||||||
}
|
|
||||||
} else if sec_max < TERRAIN_COLS {
|
|
||||||
holes.push((sec_min, sec_max));
|
|
||||||
}
|
|
||||||
|
|
||||||
emit(&mut rects, wall_row(i, n_walls), 1, &holes);
|
|
||||||
}
|
|
||||||
rects
|
|
||||||
}
|
|
||||||
|
|
||||||
fn thick(top: Door, bottom: Door, n_walls: i32, rng: &mut SplitMix64) -> Vec<GridRect> {
|
|
||||||
let (t, b) = centers(top, bottom);
|
|
||||||
let mut rects = Vec::new();
|
|
||||||
|
|
||||||
for i in 0..n_walls {
|
|
||||||
let mut c = lerp(t, b, i, n_walls);
|
|
||||||
if i < n_walls - 1 {
|
|
||||||
c += jitter(rng);
|
|
||||||
}
|
|
||||||
let h = hole(c, width(bottom, n_walls, i));
|
|
||||||
emit(&mut rects, wall_row(i, n_walls), THICK_HEIGHT, &[h]);
|
|
||||||
}
|
|
||||||
rects
|
|
||||||
}
|
|
||||||
|
|
||||||
fn staircase(top: Door, bottom: Door, n_walls: i32) -> Vec<GridRect> {
|
|
||||||
let (t, b) = centers(top, bottom);
|
|
||||||
|
|
||||||
let step = ((b - t) / (n_walls - 1) as f32).round();
|
|
||||||
let mut rects = Vec::new();
|
|
||||||
|
|
||||||
for i in 0..n_walls {
|
|
||||||
let c = t + step * i as f32;
|
|
||||||
let h = hole(c, width(bottom, n_walls, i));
|
|
||||||
emit(&mut rects, wall_row(i, n_walls), 1, &[h]);
|
|
||||||
}
|
|
||||||
rects
|
|
||||||
}
|
|
||||||
|
|
||||||
fn centers(top: Door, bottom: Door) -> (f32, f32) {
|
|
||||||
(
|
|
||||||
(top.min_col + top.max_col) as f32 * 0.5,
|
|
||||||
(bottom.min_col + bottom.max_col) as f32 * 0.5,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn lerp(t: f32, b: f32, i: i32, n: i32) -> f32 {
|
|
||||||
t + (b - t) * (i as f32 / (n - 1) as f32)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn jitter(rng: &mut SplitMix64) -> f32 {
|
|
||||||
(rng.next_u64() % 3) as f32 - 1.0 // -1..=1 column
|
|
||||||
}
|
|
||||||
|
|
||||||
fn width(bottom: Door, n: i32, i: i32) -> i32 {
|
|
||||||
(bottom.width() + n - 1 - i).clamp(HOLE_MIN_WIDTH, HOLE_MAX_WIDTH)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn hole(center: f32, w: i32) -> (i32, i32) {
|
|
||||||
let min = ((center - w as f32 * 0.5).round() as i32).clamp(0, TERRAIN_COLS - w);
|
|
||||||
(min, min + w - 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn wall_spacing(n: i32) -> i32 {
|
|
||||||
(FIRST_WALL_ROW - MIN_BOTTOM_ROW) / (n - 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn wall_row(i: i32, n: i32) -> i32 {
|
|
||||||
FIRST_WALL_ROW - i * wall_spacing(n)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn emit(rects: &mut Vec<GridRect>, row: i32, height: i32, holes: &[(i32, i32)]) {
|
|
||||||
let mut cursor = 0;
|
|
||||||
|
|
||||||
for &(h_min, h_max) in holes {
|
|
||||||
if h_max < 0 || h_min >= TERRAIN_COLS {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
let h_min = h_min.max(0);
|
|
||||||
let h_max = h_max.min(TERRAIN_COLS - 1);
|
|
||||||
|
|
||||||
if h_min > cursor {
|
|
||||||
rects.push(GridRect {
|
|
||||||
col: cursor,
|
|
||||||
row,
|
|
||||||
width: h_min - cursor,
|
|
||||||
height,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
cursor = cursor.max(h_max + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if cursor < TERRAIN_COLS {
|
|
||||||
rects.push(GridRect {
|
|
||||||
col: cursor,
|
|
||||||
row,
|
|
||||||
width: TERRAIN_COLS - cursor,
|
|
||||||
height,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn fallback_chunk(seed: u64, depth: i64) -> ChunkData {
|
|
||||||
let Some(bottom_door) = door(seed, depth) else {
|
|
||||||
return ChunkData { rects: Vec::new() };
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut rects = Vec::new();
|
|
||||||
emit(
|
|
||||||
&mut rects,
|
|
||||||
8,
|
|
||||||
1,
|
|
||||||
&[(bottom_door.min_col, bottom_door.max_col)],
|
|
||||||
);
|
|
||||||
ChunkData { rects }
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
use crate::config::CHUNK_ROWS;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn fallback_rate_is_below_one_percent() {
|
|
||||||
const SEEDS: u64 = 10_000;
|
|
||||||
const CHUNKS_PER_SEED: i64 = 200;
|
|
||||||
|
|
||||||
let mut fallbacks: u64 = 0;
|
|
||||||
let mut total: u64 = 0;
|
|
||||||
|
|
||||||
for seed in 0..SEEDS {
|
|
||||||
for depth in 2..=2 + CHUNKS_PER_SEED {
|
|
||||||
if try_generate(seed, depth).is_none() {
|
|
||||||
fallbacks += 1;
|
|
||||||
}
|
|
||||||
total += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let rate = fallbacks as f64 / total as f64;
|
|
||||||
assert!(
|
|
||||||
rate < 0.01,
|
|
||||||
"fallback rate {:.2}% too high ({} fallbacks over {} chunks)",
|
|
||||||
rate * 100.0,
|
|
||||||
fallbacks,
|
|
||||||
total
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn every_generated_chunk_is_playable() {
|
|
||||||
const SEEDS: u64 = 10_000;
|
|
||||||
const CHUNKS_PER_SEED: i64 = 200;
|
|
||||||
|
|
||||||
for seed in 0..SEEDS {
|
|
||||||
for depth in 2..=2 + CHUNKS_PER_SEED {
|
|
||||||
let chunk = generate_chunk(seed, depth);
|
|
||||||
let bottom = door(seed, depth).unwrap();
|
|
||||||
let top = door(seed, depth - 1).unwrap();
|
|
||||||
assert!(
|
|
||||||
validate(&chunk.rects, bottom, top),
|
|
||||||
"seed {} depth {} is not playable",
|
|
||||||
seed,
|
|
||||||
depth
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn generation_is_deterministic() {
|
|
||||||
for seed in 0..100 {
|
|
||||||
for depth in 2..=100 {
|
|
||||||
let a = generate_chunk(seed, depth);
|
|
||||||
let b = generate_chunk(seed, depth);
|
|
||||||
assert_eq!(a, b, "seed {} depth {} is not deterministic", seed, depth);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn every_rect_stays_inside_the_chunk() {
|
|
||||||
for seed in 0..200 {
|
|
||||||
for depth in 2..=120 {
|
|
||||||
for r in &generate_chunk(seed, depth).rects {
|
|
||||||
assert!(r.width > 0 && r.height > 0, "empty rect {:?}", r);
|
|
||||||
assert!(r.col >= 0 && r.col + r.width <= TERRAIN_COLS, "col {:?}", r);
|
|
||||||
assert!(r.row >= 0 && r.row + r.height <= CHUNK_ROWS, "row {:?}", r);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn every_variant_appears() {
|
|
||||||
let (mut classic, mut double, mut thick, mut stair) = (0, 0, 0, 0);
|
|
||||||
|
|
||||||
for seed in 0..200u64 {
|
|
||||||
for depth in 2..=120i64 {
|
|
||||||
match gap_variant(seed, depth) {
|
|
||||||
GapVariant::Classic => classic += 1,
|
|
||||||
GapVariant::Double => double += 1,
|
|
||||||
GapVariant::Thick => thick += 1,
|
|
||||||
GapVariant::Staircase => stair += 1,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assert!(classic > 0 && double > 0 && thick > 0 && stair > 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
// const OBSTACLE_COLOR: Color = Color::srgb(0.1, 0.7, 0.3);
|
// const OBSTACLE_COLOR: Color = Color::srgb(0.1, 0.7, 0.3);
|
||||||
const DEBUG_OBSTACLE_COLOR: Color = Color::srgba(0.0, 1.0, 0.0, 0.7);
|
const DEBUG_OBSTACLE_COLOR: Color = Color::srgba(0.0, 1.0, 0.0, 1.0);
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct Obstacle;
|
pub struct Obstacle;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ fn door_px(door: Door) -> (f32, f32) {
|
|||||||
fn free_intervals(rects: &[GridRect], row: i32) -> Vec<(f32, f32)> {
|
fn free_intervals(rects: &[GridRect], row: i32) -> Vec<(f32, f32)> {
|
||||||
let row_y0 = row as f32 * CELL_SIZE;
|
let row_y0 = row as f32 * CELL_SIZE;
|
||||||
let row_y1 = row_y0 + CELL_SIZE;
|
let row_y1 = row_y0 + CELL_SIZE;
|
||||||
|
|
||||||
let mut blocked: Vec<(f32, f32)> = Vec::new();
|
let mut blocked: Vec<(f32, f32)> = Vec::new();
|
||||||
for r in rects {
|
for r in rects {
|
||||||
let y0 = r.row as f32 * CELL_SIZE - INFLATE_Y;
|
let y0 = r.row as f32 * CELL_SIZE - INFLATE_Y;
|
||||||
|
|||||||
Reference in New Issue
Block a user