diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4bff253 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +dist/ +release/ diff --git a/README.md b/README.md index 6c7da79..b81447d 100644 --- a/README.md +++ b/README.md @@ -1 +1,55 @@ -# My-projects \ No newline at end of file +# Neon Forecourt + +A desktop-ready gas station simulator with stylized 3D arcade visuals, shifting neon lights, and a quick score-chasing management loop. + +## Features + +- Three playable pump lanes with incoming AI cars +- Walkable station attendant using WASD or arrow keys +- Hold-to-fuel gameplay with combo bonuses and customer patience +- Fuel-stock management with fast tanker refills +- Bloom-heavy dusk lighting, neon signage, and low-poly 3D scenery + +## Controls + +- `WASD` / arrow keys: move +- Drag mouse: orbit camera +- Mouse wheel: zoom +- `Hold E`: fuel the car at the nearest waiting pump +- `Shift`: sprint +- `R`: buy an instant tanker refill +- `Enter`: restart after the shift ends + +## Run in the browser + +```bash +npm install +npm run dev +``` + +Build for production: + +```bash +npm run build +``` + +## Run as a desktop app + +Launch the standalone Electron version: + +```bash +npm install +npm run desktop +``` + +Create a packaged desktop build for your current OS: + +```bash +npm run desktop:pack +``` + +Create installable output in `release/`: + +```bash +npm run desktop:dist +``` \ No newline at end of file diff --git a/electron/main.cjs b/electron/main.cjs new file mode 100644 index 0000000..59f3e55 --- /dev/null +++ b/electron/main.cjs @@ -0,0 +1,72 @@ +const { app, BrowserWindow } = require("electron"); +const path = require("node:path"); +const fs = require("node:fs"); +const { pathToFileURL } = require("node:url"); + +const appDataRoot = app.getPath("appData"); +const userDataDir = path.join(appDataRoot, "Neon Forecourt"); +const sessionDataDir = path.join(userDataDir, "SessionData"); +const cacheDir = path.join(userDataDir, "Cache"); + +fs.mkdirSync(userDataDir, { recursive: true }); +fs.mkdirSync(sessionDataDir, { recursive: true }); +fs.mkdirSync(cacheDir, { recursive: true }); + +app.setPath("userData", userDataDir); +app.setPath("sessionData", sessionDataDir); +app.commandLine.appendSwitch("ignore-gpu-blocklist"); +app.commandLine.appendSwitch("enable-gpu-rasterization"); +app.commandLine.appendSwitch("enable-zero-copy"); +app.commandLine.appendSwitch("disk-cache-dir", cacheDir); + +function resolveRendererEntry() { + const builtIndex = path.join(__dirname, "..", "dist", "index.html"); + const fallbackIndex = path.join(__dirname, "..", "index.html"); + const target = fs.existsSync(builtIndex) ? builtIndex : fallbackIndex; + return pathToFileURL(target).toString(); +} + +function createWindow() { + const mainWindow = new BrowserWindow({ + width: 1600, + height: 960, + minWidth: 1180, + minHeight: 760, + show: false, + backgroundColor: "#07101d", + autoHideMenuBar: true, + title: "Neon Forecourt", + webPreferences: { + contextIsolation: true, + sandbox: true, + backgroundThrottling: false, + spellcheck: false, + }, + }); + + mainWindow.once("ready-to-show", () => { + mainWindow.show(); + }); + + mainWindow.loadURL(resolveRendererEntry()); + + if (process.env.ELECTRON_OPEN_DEVTOOLS === "1") { + mainWindow.webContents.openDevTools({ mode: "detach" }); + } +} + +app.whenReady().then(() => { + createWindow(); + + app.on("activate", () => { + if (BrowserWindow.getAllWindows().length === 0) { + createWindow(); + } + }); +}); + +app.on("window-all-closed", () => { + if (process.platform !== "darwin") { + app.quit(); + } +}); diff --git a/index.html b/index.html index cea2202..aa91350 100644 --- a/index.html +++ b/index.html @@ -1,652 +1,21 @@ - - + -
- - -Countdown to Superintelligence
- -- It is possible that we will have superintelligence in a few thousand days (!); it may take longer, but I'm confident we'll get there. -
-— Sam Altman, "The Intelligence Age" (September 23, 2024)
-