MCPcopy Index your code
hub / github.com/MattSurabian/DuckHunt-JS

github.com/MattSurabian/DuckHunt-JS @v4.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.1.0 ↗ · + Follow
107 symbols 232 edges 12 files 41 documented · 38%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DUCK HUNT JS v3.0

Play the game

This is an implementation of DuckHunt in Javascript and HTML5. It uses the PixiJS rendering engine, Green Sock Animations, Howler, and Bluebird Promises.

Rendering

This game supports WebGL and Canvas rendering via the PixiJS rendering engine.

Audio

This game will attempt to use the WebAudioAPI and fallback to HTML5 Audio if necessary. Audio is loaded and controlled via HowlerJS.

Tweening

The animations in this game are a combination of PixiJS MovieClips built from sprite images and tweens. Since PixiJS doesn't provide a tweening API, Green Sock was used.

Game Logic

The flow of this game is managed using Javascript. The main chunks of business logic are implemented as ES6 classes which are transpiled to ES5 using Babel.

Working With This Repo

  • You must have nodejs installed.
  • Clone the repo into a directory of your choice
  • cd into that directory and run npm install
  • Use npm start to start a local webserver which will make the site available at http://localhost:8080/. Cross origin errors prevent this project from being accessed in the browser with the file:// protocol. This will also trigger automatic builds and reloads of the page when changes are detected in the src directory.
  • If you want to manually cut a build of the application code run npm run build

Working With Audio and Visual Assets

This repo ships with committed dist files to make it easy for developers to get up and running. If you really want to get into some leet haxing and change the way this game looks and sounds then you'll need to work with audio and image sprites. The following tasks make that possible:

  • To rebuild audio assets use npm run audio (there is a hard dependency on ffmpeg to run this task)
  • To rebuild image assets use npm run images (there is a hard dependency on texturepacker to run this task)

Bugs

Please report bugs as issues.

Contributing

Pull requests are welcome! Please ensure code style and quality compliance with npm run lint and include any built files.

Core symbols most depended-on inside this repo

createTextBox
called by 8
src/modules/Hud.js
parseQueryParamAsInt
called by 7
src/libs/levelCreator.js
getScaledClickLocation
called by 6
src/modules/Stage.js
stopAndClearTimeline
called by 4
src/modules/Character.js
pause
called by 3
src/modules/Game.js
ducksAlive
called by 3
src/modules/Stage.js
createTextureBasedCounter
called by 3
src/modules/Hud.js
flyTo
called by 2
src/modules/Duck.js

Shape

Method 94
Class 12
Function 1

Languages

TypeScript100%

Modules by API surface

src/modules/Game.js40 symbols
src/modules/Stage.js36 symbols
src/modules/Dog.js10 symbols
src/modules/Duck.js8 symbols
src/modules/Character.js7 symbols
src/modules/Hud.js5 symbols
src/libs/levelCreator.js1 symbols

For agents

$ claude mcp add DuckHunt-JS \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact