Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61cb0ce6b4 | ||
|
|
cc2877c9d8 | ||
|
|
d61fdb2382 |
32 changed files with 1231 additions and 2705 deletions
843
Cargo.lock
generated
843
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
23
Cargo.toml
23
Cargo.toml
|
|
@ -1,33 +1,30 @@
|
|||
[package]
|
||||
name = "lux-synthese"
|
||||
name = "bevyjam"
|
||||
version = "0.1.0"
|
||||
authors = ["tuxmain <tuxmain@zettascript.org>"]
|
||||
license = "AGPL-3.0-only"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
bevy = { version = "0.8.1", default-features = false, features = ["bevy_asset", "bevy_audio", "bevy_gilrs", "bevy_winit", "render", "png", "vorbis", "x11"] }
|
||||
bevy = "0.8.1"
|
||||
bevy_common_assets = { version = "0.3.0", features = ["json"] }
|
||||
bevy-inspector-egui = "0.12.1"
|
||||
bevy_rapier2d = "0.16.2"
|
||||
#crossbeam-channel = "0.5.6"
|
||||
crossbeam-channel = "0.5.6"
|
||||
rand = "0.8.5"
|
||||
rand_distr = "0.4.3"
|
||||
rapier2d = "0.14.0"
|
||||
serde = { version = "1.0.144", features = ["derive"] }
|
||||
ticktock = "0.8.0"
|
||||
wasm-bindgen = "0.2"
|
||||
|
||||
[target."cfg(not(target_arch = \"wasm32\"))".dependencies]
|
||||
#bevy-inspector-egui = "0.12.1"
|
||||
bevy_mod_picking = "0.9.0"
|
||||
# cpal = "0.14.0"
|
||||
# hexodsp = { git = "https://github.com/WeirdConstructor/HexoDSP", default-features = false }
|
||||
serde_json = "1.0.85"
|
||||
#ticktock = "0.8.0"
|
||||
hexodsp = { git = "https://git.txmn.tk/tuxmain/HexoDSP", default-features = false }
|
||||
cpal = "0.14.0"
|
||||
|
||||
[target."cfg(target_arch = \"wasm32\")".dependencies]
|
||||
#cpal = { version = "0.14.0", features = ["wasm-bindgen"] }
|
||||
cpal = { version = "0.14.0", features = ["wasm-bindgen"] }
|
||||
wasm_thread = { git = "https://github.com/chemicstry/wasm_thread" }
|
||||
|
||||
[profile.dev.package."*"]
|
||||
opt-level = 3
|
||||
|
||||
[patch.crates-io]
|
||||
wgpu = { git = "https://github.com/mockersf/wgpu/", branch = "unconditional-clear-workaround" }
|
||||
|
|
|
|||
52
README.md
52
README.md
|
|
@ -1,14 +1,4 @@
|
|||
# Lux synthesĕ
|
||||
|
||||
Combine colored lights to synthesize white light!
|
||||
|
||||
[Play in browser](https://txmn.tk/projects/lux-synthese/)
|
||||
|
||||
Download: [Linux x86_64](https://txmn.tk/projects/lux-synthese/linux-x86_64.zip), [Windows x86_64](https://txmn.tk/projects/lux-synthese/windows-x86_64.zip)
|
||||
|
||||
In latin, _lux synthesĕ_ means "light by the means of synthesis".
|
||||
|
||||
This game was developped for the [Bevy Jam #2](https://itch.io/jam/bevy-jam-2).
|
||||
# Bevyjam
|
||||
|
||||
## Controls
|
||||
|
||||
|
|
@ -16,17 +6,18 @@ This game was developped for the [Bevy Jam #2](https://itch.io/jam/bevy-jam-2).
|
|||
* **Switch character**: Tab
|
||||
* **Level up**: Enter (when character is white)
|
||||
* **Reset**: R
|
||||
* **Fullscreen**: F11
|
||||
* **Exit**: Escape
|
||||
|
||||
## TODO
|
||||
|
||||
* name
|
||||
* more filters
|
||||
* more levels
|
||||
* despawn black characters
|
||||
* despawn character when too far
|
||||
* level design
|
||||
* (?) multiplayer
|
||||
* more audio
|
||||
* bug: when reset after win, character colors are wrong
|
||||
* redshift warning
|
||||
* "jumpable" component to avoid jumping on sensors
|
||||
* bug: in level2, move the blue character to win, then reset. The characters are lighter than expected.
|
||||
|
||||
## Build
|
||||
|
||||
|
|
@ -36,6 +27,8 @@ cargo build --release
|
|||
|
||||
### WASM
|
||||
|
||||
**Audio does not work in WASM!**
|
||||
|
||||
```bash
|
||||
rustup target add wasm32-unknown-unknown
|
||||
cargo install wasm-bindgen-cli
|
||||
|
|
@ -48,33 +41,14 @@ python3 -m http.server
|
|||
|
||||
## Audio
|
||||
|
||||
This game used [HexoDSP](https://github.com/WeirdConstructor/HexoDSP) for audio synthesis.
|
||||
This game uses [HexoDSP](https://github.com/WeirdConstructor/HexoDSP) for audio synthesis.
|
||||
|
||||
The synthetizer matrix can be edited using [HexoSynth](https://github.com/WeirdConstructor/HexoSynth) visual editor.
|
||||
|
||||
However we could not get this working in WASM, hence we used simple playback audio instead for the jam. The concept of procedural audio is not abandonned but it will be for another time.
|
||||
|
||||
## Develop
|
||||
|
||||
Skip to level `N: u32` with the command `bevyjam <N>`.
|
||||
|
||||
Edit the level `N: u32` with the command `bevyjam <N> e`.
|
||||
|
||||
Editor is not available in the WASM build.
|
||||
|
||||
### Editor controls
|
||||
|
||||
* **Select**: left click to select, click in void to deselect, CTRL+click to select many, CTRL+A to select all
|
||||
* **Move selection**: arrows to move one step, Shift+arrows to move continuously
|
||||
* **Delete selection**: delete
|
||||
* **Add objects**: P=platform, C=character, A=absorbing filter, R=rotating filter, M=melty platform
|
||||
* **Move camera**: CTRL+arrows
|
||||
* **Save**: CTRL+S
|
||||
|
||||
## License
|
||||
|
||||
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/.
|
||||
This program 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.
|
||||
This program 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 this program. If not, see https://www.gnu.org/licenses/.
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load diff
BIN
assets/melty.png
BIN
assets/melty.png
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,15 +0,0 @@
|
|||
# WASM
|
||||
|
||||
sh build-wasm.sh || exit 1
|
||||
|
||||
mkdir -p target/itchio/wasm/target
|
||||
mkdir -p target/itchio/wasm/assets
|
||||
|
||||
cp -r 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 .
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
cargo build --release --target wasm32-unknown-unknown || exit 1
|
||||
echo "==> wasm-bindgen..."
|
||||
wasm-bindgen --out-name lux-synthese --out-dir target --target web target/wasm32-unknown-unknown/release/lux-synthese.wasm || exit 1
|
||||
cargo build --release --target wasm32-unknown-unknown
|
||||
# wasm-bindgen --out-name bevyjam --out-dir target --target web target/wasm32-unknown-unknown/release/bevyjam.wasm
|
||||
wasm-bindgen target/wasm32-unknown-unknown/release/bevyjam.wasm \
|
||||
--out-name bevyjam \
|
||||
--out-dir target \
|
||||
--target no-modules
|
||||
|
|
|
|||
91
index.html
91
index.html
|
|
@ -2,91 +2,16 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>Lux synthesĕ</title>
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: UacariLegacy;
|
||||
font-weight: normal;
|
||||
src: url("assets/UacariLegacy-Regular.ttf");
|
||||
}
|
||||
@font-face {
|
||||
font-family: UacariLegacy;
|
||||
font-weight: bold;
|
||||
src: url("assets/UacariLegacy-Bold.ttf");
|
||||
}
|
||||
@font-face {
|
||||
font-family: UacariLegacy-Thin;
|
||||
src: url("assets/UacariLegacy-Thin.ttf");
|
||||
}
|
||||
|
||||
html, body {
|
||||
font-family: UacariLegacy;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #222;
|
||||
}
|
||||
body {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
color: white;
|
||||
}
|
||||
h1, h2 {
|
||||
font-family: UacariLegacy-Thin;
|
||||
font-weight: normal;
|
||||
}
|
||||
canvas {
|
||||
order: 1;
|
||||
max-width: 100vw;
|
||||
max-height: 100vh;
|
||||
margin: auto;
|
||||
}
|
||||
#readme {
|
||||
order: 2;
|
||||
width: 640px;
|
||||
max-width: 100vw;
|
||||
padding: 8px;
|
||||
margin: auto;
|
||||
}
|
||||
a, a:visited {
|
||||
color: #f80;
|
||||
}
|
||||
</style>
|
||||
<title>Bevyjam</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="module">
|
||||
import init from './target/lux-synthese.js'
|
||||
init()
|
||||
<script src="./target/bevyjam.js"></script>
|
||||
<script type="text/javascript">
|
||||
wasm_bindgen("./target/bevyjam_bg.wasm").then((wasm) =>{
|
||||
wasm.run();
|
||||
});
|
||||
// import init from './target/bevyjam.js'
|
||||
// init()
|
||||
</script>
|
||||
<!-- workaround to be sure the browser will request permission to autoplay audio -->
|
||||
<audio autoplay src="assets/silence.ogg"></audio>
|
||||
<div id="readme">
|
||||
<h1>Lux synthesĕ</h1>
|
||||
<p>
|
||||
<strong>If audio does not work, please allow media autoplay in browser, then refresh this page.</strong>
|
||||
</p>
|
||||
<h2>Controls</h2>
|
||||
<ul>
|
||||
<li><strong>Move</strong>: Arrows</li>
|
||||
<li><strong>Switch</strong>: Tab</li>
|
||||
<li><strong>Level up</strong>: Enter</li>
|
||||
<li><strong>Reset</strong>: R</li>
|
||||
</ul>
|
||||
<h2>Download</h2>
|
||||
Download an executable release:
|
||||
<ul>
|
||||
<li><a href="https://txmn.tk/projects/lux-synthese/linux-x86_64.zip">Linux x86_64</a></li>
|
||||
<li><a href="https://txmn.tk/projects/lux-synthese/windows-x86_64.zip">Windows x86_64</a></li>
|
||||
</ul>
|
||||
<h2>Source</h2>
|
||||
<p>
|
||||
The source code of this free software is available in our <a href="https://git.txmn.tk/tuxmain/bevyjam/">Git repository</a>.
|
||||
</p>
|
||||
<p>
|
||||
GNU AGPL v3: CopyLeft 2022 Pascal Engélibert, Nixon Cheng<br/>
|
||||
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.<br/>
|
||||
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.<br/>
|
||||
You should have received a copy of the GNU Affero General Public License along with Lux synthesĕ. If not, see <a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue