Skip to content

jwsy/jade-shooter-22

Repository files navigation

JADE Shooter '22

A quick custom top‑down shooter built with kaboom.js and designed to be hacked on in the browser per this article https://javascript.plainenglish.io/kaboom-js-repl-it-custom-top-down-shooter-in-5-min-ebad8157073a. Fly your jade shard through waves of goofy foes, rack up points, and tweak sprites or logic to make the game your own.

What’s inside

  • A minimal kaboom.js setup with mouse/touch controls for moving and firing
  • Hero and enemy sprites ready to swap out in the sprites/ folder
  • Simple scoring, camera shake, and randomized enemy spawns
  • Hosted build artifacts in dist/ for quick deploys

Customize the game

You only need a browser to give the shooter your own flair.

  1. Fork the repl – open the project on Replit, choose Edit in Workspace, and fork it to your account.
  2. Swap sprites – upload PNGs into sprites/ and update the sprite names in code/main.js (look near the loadSprite calls).
  3. Pick your hero – set the hero sprite name around line 115 of code/main.js to match the asset you loaded.
  4. Tune enemy frequency – adjust the enemy list near line 86 and the random selection logic around line 187 to change spawn rates.
  5. Change rewards – edit the collision handling around line 207 to control score bumps, camera shake, or other effects per enemy type.

That’s it! Deploy from Replit to get your own publicly hosted shooter (e.g., https://your-game.repl.co) and keep iterating on graphics or mechanics.

Local development

npm install
npm run dev

Then open the local URL printed to the console and start blasting.

Build and publish

  • GitHub Actions: A workflow in .github/workflows/publish-image.yml installs dependencies, runs node run-build.js, and builds the Docker image with the repository Dockerfile. It pushes the result to GitHub Container Registry (GHCR) with tags derived from branches, git tags, and commit SHAs, plus a manually supplied tag when dispatching the workflow. Pushing a v* tag also creates a GitHub release automatically.
  • Dockerfile: The image uses an unprivileged nginx base that serves the built assets on port 8080. aio off; is injected via nginx-aio.conf to prevent a startup crash on kernels that don't support io_uring (nginx 1.25+).
FROM nginxinc/nginx-unprivileged
EXPOSE 8080
COPY dist/ /usr/share/nginx/html
COPY nginx-aio.conf /etc/nginx/conf.d/aio.conf

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx","-g","daemon off;"]

Note: The exposed port changed from 80 to 8080 when switching to the unprivileged base image. Update any K8s manifests accordingly — see jwsy/simplest-k8s for an example deployment.