diff --git a/Cargo.lock b/Cargo.lock index 126b32c..a214a75 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1313,7 +1313,6 @@ dependencies = [ "parking_lot 0.12.1", "stdweb", "thiserror", - "wasm-bindgen", "web-sys", "windows", ] @@ -3760,7 +3759,7 @@ dependencies = [ "js-sys", "log", "naga", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "raw-window-handle 0.4.3", "smallvec", "wasm-bindgen", @@ -3785,7 +3784,7 @@ dependencies = [ "fxhash", "log", "naga", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "profiling", "raw-window-handle 0.4.3", "smallvec", @@ -3821,7 +3820,7 @@ dependencies = [ "metal", "naga", "objc", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "profiling", "range-alloc", "raw-window-handle 0.4.3", diff --git a/Cargo.toml b/Cargo.toml index fd3c589..1158949 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "1.0.85" ticktock = "0.8.0" [target."cfg(target_arch = \"wasm32\")".dependencies] -cpal = { version = "0.14.0", features = ["wasm-bindgen"] } +#cpal = { version = "0.14.0", features = ["wasm-bindgen"] } [profile.dev.package."*"] opt-level = 3 diff --git a/README.md b/README.md index d46aca3..3aaeb14 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,15 @@ # Lux synthesĕ +[Play in browser](https://txmn.tk/projects/lux-synthese/) + ## Controls * **Move**: arrows * **Switch character**: Tab * **Level up**: Enter (when character is white) * **Reset**: R +* **Fullscreen**: F11 +* **Exit**: Escape ## TODO diff --git a/assets/UacariLegacy-Bold.ttf b/assets/UacariLegacy-Bold.ttf new file mode 100644 index 0000000..7309e66 Binary files /dev/null and b/assets/UacariLegacy-Bold.ttf differ diff --git a/assets/UacariLegacy-Regular.ttf b/assets/UacariLegacy-Regular.ttf new file mode 100644 index 0000000..7eb6474 Binary files /dev/null and b/assets/UacariLegacy-Regular.ttf differ diff --git a/assets/game.levels.json b/assets/game.levels.json index bd87468..632dd99 100644 --- a/assets/game.levels.json +++ b/assets/game.levels.json @@ -59,10 +59,10 @@ { "pos": [ 0.0, - 0.0 + 64.0 ], "font_size": 32.0, - "text": "Combine the colors to synthetize a white light.\nUse arrows to move." + "text": "Combine the colors\nto synthetize a white light.\nUse arrows to move." } ] }, @@ -374,11 +374,11 @@ "texts": [ { "pos": [ - 0.0, + -304.0, -64.0 ], "font_size": 32.0, - "text": "Too much light\ncause some platforms to melt." + "text": "Too much light\ncauses some platforms to melt." } ] }, diff --git a/build-itchio.sh b/build-itchio.sh index 62759b7..2657220 100644 --- a/build-itchio.sh +++ b/build-itchio.sh @@ -7,6 +7,7 @@ cp assets/* target/itchio/wasm/assets/ cp index.html target/itchio/wasm/ cp target/lux-synthese.js target/itchio/wasm/target/ cp target/lux-synthese_bg.wasm target/itchio/wasm/target/ +jq -c < assets/game.levels.json > target/itchio/wasm/assets/game.levels.json cd target/itchio/wasm zip -r ../wasm.zip . diff --git a/index.html b/index.html index f36746d..159b08a 100644 --- a/index.html +++ b/index.html @@ -3,13 +3,61 @@ Lux synthesĕ + -
+

Lux synthesĕ

Note: audio does not work in the WASM build. @@ -27,9 +75,9 @@ init()

GNU AGPL v3: CopyLeft 2022 Pascal Engélibert, Nixon Cheng
- Lux synthesĕ is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License.
- Lux synthesĕ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
- You should have received a copy of the GNU Affero General Public License along with Lux synthesĕ. If not, see https://www.gnu.org/licenses/. + Lux synthesĕ is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License.
+ Lux synthesĕ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
+ You should have received a copy of the GNU Affero General Public License along with Lux synthesĕ. If not, see https://www.gnu.org/licenses/.

diff --git a/src/game.rs b/src/game.rs index 0816bfa..00a0e94 100644 --- a/src/game.rs +++ b/src/game.rs @@ -300,11 +300,7 @@ fn char_char_collision_event_system( mut commands: Commands, mut collision_events: EventReader, - character_query: Query<( - &CharacterColor, - &Transform, - Option<&Player>, - )>, + character_query: Query<(&CharacterColor, &Transform, Option<&Player>)>, mut character_list: ResMut, mut app_state: ResMut>, diff --git a/src/main.rs b/src/main.rs index d26e9f1..7595622 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ mod particle_effect; use bevy::{ asset::{Asset, HandleId, LoadState}, prelude::*, - window::{WindowId, WindowMode}, + window::{WindowMode, WindowResizeConstraints}, }; use bevy_common_assets::json::JsonAssetPlugin; use bevy_rapier2d::prelude::*; @@ -58,6 +58,19 @@ fn main() { let mut app = App::new(); app.insert_resource(Msaa { samples: 4 }) + .insert_resource(WindowDescriptor { + width: 640.0, + height: 480.0, + resize_constraints: WindowResizeConstraints { + min_width: 256., + min_height: 256., + max_width: f32::INFINITY, + max_height: f32::INFINITY, + }, + resizable: true, + title: "Lux synthesĕ".into(), + ..Default::default() + }) .insert_resource(audio_event_sender) .insert_resource(UseEditor(use_editor)) .add_state(AppState::Loading) @@ -88,12 +101,7 @@ fn main() { .run(); } -fn setup(mut commands: Commands, mut windows: ResMut, asset_server: Res) { - windows - .get_mut(WindowId::primary()) - .unwrap() - .set_title(String::from("Bevyjam")); - +fn setup(mut commands: Commands, asset_server: Res) { let mut assets = LoadingAssets(Vec::new()); commands.insert_resource( assets.add(asset_server.load::("game.levels.json")),