Underground 2 Revived
Play Need for Speed: Underground 2 (2004) in Chrome and Firefox with WebGPU graphics, Web Audio, up to 120 fps widescreen, controller support, free roam and Online races with friends. Fan project, not
翻譯準備中
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證This application allows the user to control a frog and attempt to get across lanes of traffic.
翻譯準備中
正在載入完整 README。
檢視完整 README ↗2D game made to practice collision detection and movement. Get the frog across the lanes of traffic to the Pond.
g++)makesudo apt-get install libsdl2-dev libsdl2-image-dev
A VS Code dev container that installs these is provided under .devcontainer/.
make
This writes an executable named frogHopper_executable to the repository root. make clean removes it.
./frogHopper_executable
The game resolves its assets against the directory holding the executable, so resources/ must sit next to frogHopper_executable. The default build satisfies this because both end up in the repository root. The working directory the game is launched from does not matter.
A window titled "Frog Hopper" opens at 1000x750.
The frog is controlled with the four arrow keys. Movement continues while a key is held and stops when it is released.
Four cars cross the screen, two travelling right and two travelling left. Each car reappears on the far side once it has left the screen.
From either end screen, releasing any key returns to the game, and closing the window exits. A key that was already held when the screen appeared counts too, so letting go of an arrow key held into a car or across the top dismisses the screen straight away.
Play then picks up where it stopped: the frog goes back to the bottom of the screen, standing still in the column it was in, and the cars carry on from where they were. Each return starts a new attempt, so the crossing time (see "High scores" below) counts again from the frog's next move.
Each release from v1.1.0 on carries a Windows x64 zip and a Linux x64 tarball, each with a .sha256. The Linux build needs the system's SDL2 and SDL2_image (sudo apt-get install libsdl2-2.0-0 libsdl2-image-2.0-0); the Windows zip carries its DLLs. How releases are made: docs/RELEASING.md.
The game also runs in a web browser, built with Emscripten:
On a keyboard the arrow keys work as in the desktop game. On a phone or tablet, four on-screen arrow buttons appear under the game; hold one to keep moving, or tap it for a short hop. They also leave the win and lose screens. The browser version does not send usage reports.
To build it, install and activate the Emscripten SDK, then run:
web/build.sh
This writes index.html, index.js, index.wasm, index.data (the preloaded resources/) and arcade-scores.js (see below) to web/build/. Serve that directory over HTTP to play it locally, e.g. python3 -m http.server --directory web/build 8000 and open http://localhost:8000. The page itself is web/shell.html. The Browser build workflow builds it on every pull request and every push to master. It deploys to https://frog-hopper.play.danielstephenson.dev only on a push to master while the repository variable ARCADE_ENABLED is true, or when the workflow is run by hand; the runs a pull request triggers never deploy.
In the browser version, a signed-in player's crossing times go to the "Fastest crossing" leaderboard (fastest-crossing, lower is better) of arcade-social at https://api.play.danielstephenson.dev. A crossing is timed in game time: the frames from the frog's first move of the attempt until it reaches the pond, at 60 frames a second, in seconds to two decimals (holding up from the start, about 3.13 s, is the fastest possible). Every crossing is sent and the service keeps each player's best. Two achievements are unlocked too: first-win (the first crossing) and under-five (a crossing under five seconds).
Sign-in happens on arcade-social's own page; the game never sees a password, and nothing is sent while signed out, from any address other than https://frog-hopper.play.danielstephenson.dev, or from the desktop game (the calls are compiled only under __EMSCRIPTEN__). Scores are reported by the player's browser and can be forged, so the board is labelled "not verified". The client is web/arcade-scores.js, vendored unchanged from arcade-social's clients/js; web/build.sh copies it next to the page, web/shell.html loads it, and src/FrogHopper.cpp calls it through EM_JS. Its calls never throw: a refused or lost score is dropped and the game carries on.
The game reports to trace by default: one startup event per launch, carrying the program name (Frog-Hopper-2D), its version from version.txt, and a random installation ID. Nothing about you, your machine or the game is sent (the trace server sees the IP address of the request, as every web server does).
The first run prints one line saying so on stderr and writes a small settings file, usage-reporting.conf, to $XDG_CONFIG_HOME/Frog-Hopper-2D/ (by default ~/.config/Frog-Hopper-2D/; ~/Library/Application Support/Frog-Hopper-2D/ on macOS, %APPDATA%\Frog-Hopper-2D\ on Windows). To turn reporting off:
enabled=false in that file, orTRACE_USAGE_REPORTING=off or DO_NOT_TRACK=1 in the environment (this turns it off for every trace-reporting program, and nothing is printed or written).The installation ID is a random UUID, made the first time reporting is on and kept in trace-install-id in $XDG_DATA_HOME/frog-hopper-2d/ (by default ~/.local/share/frog-hopper-2d/; ~/Library/Application Support/frog-hopper-2d/ on macOS, %APPDATA%\frog-hopper-2d\ on Windows). It is not derived from anything about you or your machine; it only lets trace count installations rather than launches. Delete the file to reset it. Setting TRACE_INSTALL_ID sends that value instead, and the file is left alone. Every opt-out above also stops the ID: with reporting off, the file is never created, read or sent.
The event is sent in the background by the vendored trace-client-cpp header (src/header/trace_client.hpp) through the system curl; if curl is missing or the machine is offline, nothing is sent and the game is unaffected. FROG_HOPPER_2D_USAGE_REPORTING_ENDPOINT points reporting at another server, e.g. a local one while testing. An endpoint= line in the settings file does the same, and the environment variable wins when both are set. Details: https://github.com/Stephenson-Software/trace#usage-reporting
This project is licensed under the Stephenson Software Non-Commercial License (Stephenson-NC). See LICENSE.