Simple breakout clone with powerups
Use CMake to set up the project, which also downloads dependencies such as Raylib.
$ cmake --preset debugOnce the project is set up, you can either keep recompiling the game manually after changing the source code, or running the Python script build.py with the argument dev to enable hot-reloading.
$ python3 build.py devIf you don't have Python installed, or don't need hot reloading, simply build using CMake:
$ cmake --build --preset debugThis project uses CPack to prepare release bundles for the game. To do bundle a release using CPack, you'll need to first make sure to generate the build files using the release preset:
$ cmake --preset releaseOnce the release preset is set up, simply build the bundle target using CMake -- no need to invoke CPack directly:
$ cmake --build --preset release --target bundleReleasing for the web requires the use of a specific CMake preset called web-release, and this preset requires you to have Emscripten-related binaries and environment variables on your terminal.
To do this, install emsdk from the following repository: https://github.com/emscripten-core/emsdk/
Then, use the emsdk_env script to load the Emscripten environment variables to your shell session:
Windows - Command Prompt
> path\to\emsdk\emsdk_env.batWindows - Powershell
> path\to\emsdk\emsdk_env.ps1macOS, Linux, BSD
> path/to/emsdk/emsdk_env.shOnce Emscripten is activated, the rest of the process is the same as native releases.
$ cmake --preset web-release
$ cmake --build --preset web-releaseIf you wish to bundle it as a zip file instead:
$ cmake --build --preset web-release --target bundleDue to how browsers restrict the loading of local files when an HTML file is being displayed, simply opening the index.html file will not let you play the game.
Instead, you'll have to run a web server capable of serving static files, and host your index.html as well as assets from there.
If you have Python installed, the easiest way to do it would be to use the http.server module to run a local file server.
$ cd bin/web-release
# hosts the file server on port 8000
# after running this command, you can visit http://localhost:8000 to play the game
$ python3 -m http.server 8000- Fonts
- Press Start 2P Author: Codeman38 Website: https://www.dafont.com/press-start-2p.font
No LLM-generated code was used in this codebase directly, and every single line of code has been hand-written.
However, the assistance of LLMs (mostly Gemini, and very little Claude) were used during the development processs in the following manner:
- To review and vet hand-written code
- To consult about whether an approach taken in the codebase is idomatic, and if there are better alternatives
- To ask for example CMake configurations to use as reference
- To use as a documentation tool for macOS frameworks such as Cocoa
- To troubleshoot compilation, build and bundling errors
MIT