Compare commits

12 Commits

Author SHA1 Message Date
8dce41f26e remove workflow 2026-03-18 22:59:28 -04:00
366fbd7c49 feat: add Tauri desktop builds, improve gameplay UX, and clean repo
Some checks failed
desktop-builds / build-linux (push) Failing after 0s
desktop-builds / build-windows (push) Failing after 0s
2026-03-18 22:46:45 -04:00
c04327c380 ai code cleanup 2026-03-18 22:12:25 -04:00
zbww
1a6dadec0c Update README.md 2014-12-04 11:30:43 +08:00
zbww
0279005431 Update README.md 2014-12-04 11:29:00 +08:00
zbww
83b5ffaa73 Update README.md 2014-12-03 23:08:07 +08:00
zbww
118388e13b Update README.md 2014-12-03 23:06:51 +08:00
zbww
00f57b4363 Update README.md 2014-12-03 23:02:56 +08:00
zbww
8f0d187e78 Update README.md 2014-12-03 22:53:28 +08:00
zbww
fa445f2eff Update README.md 2014-11-30 22:28:13 +08:00
zbww
791486f5e3 Update README.md 2014-11-23 11:09:43 +08:00
zbww
2c7c19ee91 Update README.md 2014-11-23 11:07:30 +08:00
36 changed files with 6570 additions and 324 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
node_modules/
dist/
src-tauri/target/

236
README.md
View File

@@ -1,4 +1,234 @@
EndlessSea
==========
# Endless Sea
A javascript game, create in the summer of 2014.
Endless Sea is a small browser survival game built with HTML5 canvas, jQuery, and plain JavaScript. You guide a fish through an underwater bullet-hell style field, avoid incoming hazards, and collect diamonds to trigger temporary power-ups.
## Play
- Live demo: https://zbww.github.io/EndlessSea
- Original source reference: https://github.com/zbww/EndlessSea/blob/master/js/main.js
## How To Play
- Move the mouse to steer the fish.
- Avoid every flying object except diamonds.
- Collect diamonds to gain temporary bonuses.
- Press `Space`, `Enter`, or `P` to pause and resume.
- Use headphones if you want the full audio experience.
## Power-Ups
Diamonds can trigger one of several effects:
- Score bonus
- Speed Down
- 1 UP
- Superfish invincibility
- Big Bomb screen clear
- Small World size reduction
## Running Locally
This project is static and does not require a build step.
1. Clone or download the repository.
2. Open `index.html` in a modern browser.
If your browser blocks autoplay audio, start the game with a click so music playback can begin normally.
## Desktop Builds
This repository includes a Tauri desktop wrapper under `src-tauri/`. The frontend is copied into `dist/` before each desktop build.
### Build Overview
1. Install Bun.
2. Install Rust.
3. Install the platform-specific Tauri dependencies for the OS you are building on.
4. Run `bun install`.
5. Run one of the build commands below.
### Shared Project Setup
Install dependencies once per clone:
```bash
bun install
```
You can also stage the static frontend manually:
```bash
bun run build:web
```
That copies `index.html`, `css/`, `js/`, and `music/` into `dist/`.
### Linux Native Build
The Linux build has been verified on this repository and currently produces `.deb` and `.rpm` bundles.
Install Bun on Linux:
```bash
curl -fsSL https://bun.sh/install | bash
```
Install Rust on Linux:
```bash
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
```
If Bun or Rust are not on your shell `PATH` yet, restart the terminal before continuing.
Install the Tauri system packages for your distribution.
Debian or Ubuntu:
```bash
sudo apt update
sudo apt install \
libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
patchelf \
rpm
```
Fedora:
```bash
sudo dnf check-update
sudo dnf install \
webkit2gtk4.1-devel \
openssl-devel \
curl \
wget \
file \
libappindicator-gtk3-devel \
librsvg2-devel \
libxdo-devel \
patchelf \
rpm-build
sudo dnf group install "c-development"
```
Build the Linux desktop packages:
```bash
bun install
bun run tauri:build:linux
```
Expected outputs:
- `src-tauri/target/release/bundle/deb/Endless Sea_0.1.0_amd64.deb`
- `src-tauri/target/release/bundle/rpm/Endless Sea-0.1.0-1.x86_64.rpm`
### Windows Native Build
For a full Windows installer, build on a Windows machine. This is the most reliable path.
Install Bun in PowerShell:
```powershell
irm bun.sh/install.ps1 | iex
```
Install Rust with the MSVC toolchain:
```powershell
winget install --id Rustlang.Rustup
rustup default stable-msvc
```
Install the required Windows components:
1. Install Microsoft C++ Build Tools.
2. In the installer, enable `Desktop development with C++`.
3. Make sure Microsoft Edge WebView2 Runtime is installed.
Build the Windows installer:
```powershell
bun install
bun run tauri:build
```
Expected output:
- `src-tauri/target/release/bundle/nsis/Endless Sea_0.1.0_x64-setup.exe`
### Windows Cross-Build From Linux
If you are on Linux and only need a Windows `.exe`, you can cross-compile it without packaging an installer.
Install the extra cross-build tools:
```bash
sudo apt update
sudo apt install nsis lld llvm
rustup target add x86_64-pc-windows-msvc
cargo install --locked cargo-xwin
```
Build the Windows executable only:
```bash
bun install
bun run tauri:build:windows:exe
```
Expected output:
- `src-tauri/target/x86_64-pc-windows-msvc/release/endless-sea.exe`
If you want to attempt a full NSIS installer from Linux, use:
```bash
bun install
bun run tauri:build:windows:cross
```
Important note:
- Cross-compiling the Windows installer from Linux is experimental in Tauri.
- On this machine, the executable build worked, but the NSIS installer step failed because `makensis.exe` was not available in the Linux environment.
- If you need a reliable signed installer, use a real Windows build machine.
### Build Outputs
- Browser-ready static build: `dist/`
- Linux desktop binary: `src-tauri/target/release/endless-sea`
- Linux bundles: `src-tauri/target/release/bundle/`
- Windows cross-compiled binary: `src-tauri/target/x86_64-pc-windows-msvc/release/endless-sea.exe`
### Troubleshooting
- If `bun` is not found after installation, restart the shell or add Bun to your `PATH`.
- If `cargo` or `rustup` are not found, restart the shell so Cargo's environment is loaded.
- If Linux packaging fails with missing GTK or WebKit packages, re-check the distro-specific dependency list above.
- If a Windows installer build fails on Linux around NSIS, fall back to the `.exe` cross-build or build natively on Windows.
## Project Notes
- Most visible game elements are generated dynamically in JavaScript.
- All game graphics are drawn in code with canvas rather than external image assets.
- Audio files are included in the repository under `music/`.
## Credits
Developers:
- Bobwei Zhou
- Yangmei Lin
Original development period:
- July 12, 2014 to July 16, 2014

37
bun.lock Normal file
View File

@@ -0,0 +1,37 @@
{
"lockfileVersion": 1,
"configVersion": 1,
"workspaces": {
"": {
"name": "endless-sea",
"devDependencies": {
"@tauri-apps/cli": "^2.10.1",
},
},
},
"packages": {
"@tauri-apps/cli": ["@tauri-apps/cli@2.10.1", "", { "optionalDependencies": { "@tauri-apps/cli-darwin-arm64": "2.10.1", "@tauri-apps/cli-darwin-x64": "2.10.1", "@tauri-apps/cli-linux-arm-gnueabihf": "2.10.1", "@tauri-apps/cli-linux-arm64-gnu": "2.10.1", "@tauri-apps/cli-linux-arm64-musl": "2.10.1", "@tauri-apps/cli-linux-riscv64-gnu": "2.10.1", "@tauri-apps/cli-linux-x64-gnu": "2.10.1", "@tauri-apps/cli-linux-x64-musl": "2.10.1", "@tauri-apps/cli-win32-arm64-msvc": "2.10.1", "@tauri-apps/cli-win32-ia32-msvc": "2.10.1", "@tauri-apps/cli-win32-x64-msvc": "2.10.1" }, "bin": { "tauri": "tauri.js" } }, "sha512-jQNGF/5quwORdZSSLtTluyKQ+o6SMa/AUICfhf4egCGFdMHqWssApVgYSbg+jmrZoc8e1DscNvjTnXtlHLS11g=="],
"@tauri-apps/cli-darwin-arm64": ["@tauri-apps/cli-darwin-arm64@2.10.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Z2OjCXiZ+fbYZy7PmP3WRnOpM9+Fy+oonKDEmUE6MwN4IGaYqgceTjwHucc/kEEYZos5GICve35f7ZiizgqEnQ=="],
"@tauri-apps/cli-darwin-x64": ["@tauri-apps/cli-darwin-x64@2.10.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-V/irQVvjPMGOTQqNj55PnQPVuH4VJP8vZCN7ajnj+ZS8Kom1tEM2hR3qbbIRoS3dBKs5mbG8yg1WC+97dq17Pw=="],
"@tauri-apps/cli-linux-arm-gnueabihf": ["@tauri-apps/cli-linux-arm-gnueabihf@2.10.1", "", { "os": "linux", "cpu": "arm" }, "sha512-Hyzwsb4VnCWKGfTw+wSt15Z2pLw2f0JdFBfq2vHBOBhvg7oi6uhKiF87hmbXOBXUZaGkyRDkCHsdzJcIfoJC2w=="],
"@tauri-apps/cli-linux-arm64-gnu": ["@tauri-apps/cli-linux-arm64-gnu@2.10.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-OyOYs2t5GkBIvyWjA1+h4CZxTcdz1OZPCWAPz5DYEfB0cnWHERTnQ/SLayQzncrT0kwRoSfSz9KxenkyJoTelA=="],
"@tauri-apps/cli-linux-arm64-musl": ["@tauri-apps/cli-linux-arm64-musl@2.10.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-MIj78PDDGjkg3NqGptDOGgfXks7SYJwhiMh8SBoZS+vfdz7yP5jN18bNaLnDhsVIPARcAhE1TlsZe/8Yxo2zqg=="],
"@tauri-apps/cli-linux-riscv64-gnu": ["@tauri-apps/cli-linux-riscv64-gnu@2.10.1", "", { "os": "linux", "cpu": "none" }, "sha512-X0lvOVUg8PCVaoEtEAnpxmnkwlE1gcMDTqfhbefICKDnOTJ5Est3qL0SrWxizDackIOKBcvtpejrSiVpuJI1kw=="],
"@tauri-apps/cli-linux-x64-gnu": ["@tauri-apps/cli-linux-x64-gnu@2.10.1", "", { "os": "linux", "cpu": "x64" }, "sha512-2/12bEzsJS9fAKybxgicCDFxYD1WEI9kO+tlDwX5znWG2GwMBaiWcmhGlZ8fi+DMe9CXlcVarMTYc0L3REIRxw=="],
"@tauri-apps/cli-linux-x64-musl": ["@tauri-apps/cli-linux-x64-musl@2.10.1", "", { "os": "linux", "cpu": "x64" }, "sha512-Y8J0ZzswPz50UcGOFuXGEMrxbjwKSPgXftx5qnkuMs2rmwQB5ssvLb6tn54wDSYxe7S6vlLob9vt0VKuNOaCIQ=="],
"@tauri-apps/cli-win32-arm64-msvc": ["@tauri-apps/cli-win32-arm64-msvc@2.10.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-iSt5B86jHYAPJa/IlYw++SXtFPGnWtFJriHn7X0NFBVunF6zu9+/zOn8OgqIWSl8RgzhLGXQEEtGBdR4wzpVgg=="],
"@tauri-apps/cli-win32-ia32-msvc": ["@tauri-apps/cli-win32-ia32-msvc@2.10.1", "", { "os": "win32", "cpu": "ia32" }, "sha512-gXyxgEzsFegmnWywYU5pEBURkcFN/Oo45EAwvZrHMh+zUSEAvO5E8TXsgPADYm31d1u7OQU3O3HsYfVBf2moHw=="],
"@tauri-apps/cli-win32-x64-msvc": ["@tauri-apps/cli-win32-x64-msvc@2.10.1", "", { "os": "win32", "cpu": "x64" }, "sha512-6Cn7YpPFwzChy0ERz6djKEmUehWrYlM+xTaNzGPgZocw3BD7OfwfWHKVWxXzdjEW2KfKkHddfdxK1XXTYqBRLg=="],
}
}

View File

@@ -1,54 +1,59 @@
html, body
{
margin:0;
padding:0;
overflow:hidden;
background:#0d1f38;
}
#die,#startgame,#pause
{
cursor:default;
position:absolute;
width:400px;
height:200px;
background:#3369cd;
opacity:0.7;
width:420px;
min-height:260px;
padding:14px 0 20px;
background:rgba(24,71,153,0.82);
text-align:center;
font-family:'华文细黑', 'STHeiti Light','STXihei','黑体';
font-size:36px;
font-family:'Segoe UI', 'Trebuchet MS', Arial, sans-serif;
font-size:34px;
color:#eef;
box-shadow: 7px 7px 10px rgba(255,255,255,0.3);
border:1px solid #fff;
box-shadow:0 16px 40px rgba(6,20,47,0.35);
border:1px solid rgba(255,255,255,0.65);
border-radius:18px;
backdrop-filter:blur(8px);
}
#instructions,#about,#score,#ranking
#instructions,#about,#score,#ranking,#settingsbutton,#fullscreenbutton,#scorereset
{
font-size:36px;
font-size:30px;
margin-top:12px;
}
.title
{
border-bottom:2px solid #430fc8;
position: absolute;
height: auto;
font-family:'华文细黑', 'STHeiti Light','STXihei','黑体';
position:absolute;
height:auto;
font-family:'Segoe UI', 'Trebuchet MS', Arial, sans-serif;
font-size:50px;
font-weight: bold;
font-weight:bold;
color:#430fc8;
}
.moreinfo/*两侧的窗口*/
.moreinfo
{
position:absolute;
font-family:'华文细黑', 'STHeiti Light','STXihei','黑体';
font-family:'Segoe UI', 'Trebuchet MS', Arial, sans-serif;
font-size:18px;
height:200px;
background:#1954c0;
opacity:0.7;
padding-left:10px;
min-height:220px;
background:rgba(25,84,192,0.78);
padding:12px 16px;
text-align:left;
color:#eef;
box-shadow: 7px 7px 10px rgba(255,255,255,0.3);
border:1px solid #fff;
box-shadow:0 16px 40px rgba(6,20,47,0.25);
border:1px solid rgba(255,255,255,0.65);
border-radius:16px;
display:none;
}
@@ -56,7 +61,7 @@
{
position:absolute;
text-align:center;
font-family:'华文细黑', 'STHeiti Light','STXihei','黑体';
font-family:'Segoe UI', 'Trebuchet MS', Arial, sans-serif;
font-size:18px;
width:200px;
height:100px;
@@ -65,15 +70,118 @@
.button
{
margin-top:11px;
background:#227;
cursor:pointer;
width:80%;
margin:11px auto 0;
padding:8px 12px;
background:rgba(34,34,119,0.76);
border:1px solid rgba(255,255,255,0.25);
border-radius:12px;
transition:background 0.2s ease, transform 0.2s ease;
}
.button:hover
{
background:rgba(53,53,160,0.88);
transform:translateY(-1px);
}
.right2
{
margin-top: 5px;
font-size: 22px;
margin-left: 20px;
margin-top:5px;
font-size:22px;
margin-left:20px;
}
#settingspanel
{
position:absolute;
width:300px;
padding:16px;
background:rgba(12,34,70,0.88);
color:#eef;
border:1px solid rgba(255,255,255,0.65);
border-radius:16px;
box-shadow:0 18px 48px rgba(5,13,33,0.35);
font-family:'Segoe UI', 'Trebuchet MS', Arial, sans-serif;
display:none;
}
.settings-title
{
font-size:28px;
margin-bottom:10px;
text-align:center;
}
.settings-row
{
margin-top:12px;
}
.settings-label
{
display:flex;
justify-content:space-between;
align-items:center;
font-size:16px;
margin-bottom:6px;
}
.settings-label span:last-child
{
color:#b9d8ff;
font-size:14px;
}
.settings-range
{
width:100%;
}
.settings-toggle
{
display:flex;
justify-content:space-between;
align-items:center;
font-size:16px;
}
.settings-actions
{
display:flex;
flex-direction:column;
gap:8px;
margin-top:14px;
}
.settings-button
{
cursor:pointer;
border:1px solid rgba(255,255,255,0.25);
border-radius:10px;
padding:8px 10px;
background:rgba(53,93,165,0.62);
text-align:center;
font-size:15px;
}
.settings-button:hover
{
background:rgba(75,118,196,0.75);
}
.settings-note
{
margin-top:12px;
font-size:13px;
line-height:1.35;
color:#c5dbff;
}
#pausemessage
{
margin-top:10px;
font-size:16px;
color:#d8e8ff;
}

View File

@@ -2,13 +2,12 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Endless Sea</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<script src="js/jquery-2.1.1.min.js"></script>
</head>
<script src="js/jquery-2.1.1.min.js">
</script>
<body>
<script src="js/main.js"></script>
</body>
<script src="js/main.js">
</script>
</html>

1006
js/main.js

File diff suppressed because it is too large Load Diff

17
package.json Normal file
View File

@@ -0,0 +1,17 @@
{
"name": "endless-sea",
"private": true,
"version": "0.1.0",
"description": "Endless Sea desktop wrapper built with Tauri",
"scripts": {
"build:web": "bun run ./scripts/build-web.mjs",
"tauri:dev": "bunx tauri dev",
"tauri:build": "bunx tauri build",
"tauri:build:linux": "bunx tauri build",
"tauri:build:windows:cross": "bunx tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc",
"tauri:build:windows:exe": "bunx tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc --no-bundle"
},
"devDependencies": {
"@tauri-apps/cli": "^2.10.1"
}
}

Binary file not shown.

Binary file not shown.

25
scripts/build-web.mjs Normal file
View File

@@ -0,0 +1,25 @@
import { cp, mkdir, rm } from "node:fs/promises";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const scriptDir = dirname(fileURLToPath(import.meta.url));
const rootDir = resolve(scriptDir, "..");
const distDir = resolve(rootDir, "dist");
const copyTargets = [
"index.html",
"css",
"js",
"music"
];
await rm(distDir, { recursive: true, force: true });
await mkdir(distDir, { recursive: true });
for (const target of copyTargets) {
await cp(resolve(rootDir, target), resolve(distDir, target), {
recursive: true
});
}
console.log(`Built static frontend into ${distDir}`);

4
src-tauri/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Generated by Cargo
# will have compiled files and executables
/target/
/gen/schemas

5259
src-tauri/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

25
src-tauri/Cargo.toml Normal file
View File

@@ -0,0 +1,25 @@
[package]
name = "endless-sea"
version = "0.1.0"
description = "Endless Sea desktop wrapper"
authors = ["Endless Sea contributors"]
license = "MIT"
repository = "https://github.com/zbww/EndlessSea"
edition = "2021"
rust-version = "1.77.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "endless_sea_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2.5.6", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
log = "0.4"
tauri = { version = "2.10.3", features = [] }
tauri-plugin-log = "2"

3
src-tauri/build.rs Normal file
View File

@@ -0,0 +1,3 @@
fn main() {
tauri_build::build()
}

View File

@@ -0,0 +1,11 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "enables the default permissions",
"windows": [
"main"
],
"permissions": [
"core:default"
]
}

BIN
src-tauri/icons/128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
src-tauri/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
src-tauri/icons/icon.icns Normal file

Binary file not shown.

BIN
src-tauri/icons/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
src-tauri/icons/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

16
src-tauri/src/lib.rs Normal file
View File

@@ -0,0 +1,16 @@
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.setup(|app| {
if cfg!(debug_assertions) {
app.handle().plugin(
tauri_plugin_log::Builder::default()
.level(log::LevelFilter::Info)
.build(),
)?;
}
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

6
src-tauri/src/main.rs Normal file
View File

@@ -0,0 +1,6 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
endless_sea_lib::run();
}

38
src-tauri/tauri.conf.json Normal file
View File

@@ -0,0 +1,38 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Endless Sea",
"version": "0.1.0",
"identifier": "com.endlesssea.desktop",
"build": {
"frontendDist": "../dist",
"beforeDevCommand": "bun run build:web",
"beforeBuildCommand": "bun run build:web"
},
"app": {
"windows": [
{
"title": "Endless Sea",
"width": 1280,
"height": 720,
"minWidth": 800,
"minHeight": 600,
"center": true,
"resizable": true,
"fullscreen": false
}
],
"security": {
"csp": null
}
},
"bundle": {
"active": true,
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
}
}

View File

@@ -0,0 +1,9 @@
{
"$schema": "https://schema.tauri.app/config/2",
"bundle": {
"targets": [
"deb",
"rpm"
]
}
}

View File

@@ -0,0 +1,16 @@
{
"$schema": "https://schema.tauri.app/config/2",
"bundle": {
"targets": [
"nsis"
],
"windows": {
"webviewInstallMode": {
"type": "downloadBootstrapper"
},
"nsis": {
"displayLanguageSelector": true
}
}
}
}