A simple arcade game clone.
- Three-step collision detection using grid proximity, sprite box, and tangential collision respectively.
- Angular blood effects taking into account the players collision angle with an object.
- Optimized memory management. There are extremely few new objects/functions allocated during play.
- Use of Promises/A+ for preloading assets.
- Multiple canvases are used to reduce drawing complexity.
- JSON objects are converted to include scripts to allow the game to play without a web server.
- Service Worker support installing all assets upon first launch.
- Extensive build suite using Gulp task runner.
- Minification of all game assets including HTML, CSS, JavaScript, and images.
- Builds a file manifest for caching assets with a service worker.
- Compiles JSON data files to JavaScript for use with local browsing.
- Compiles TypeScript and Sass to JavaScript and CSS.
All current desktop browsers are supported. The application uses JavaScript Promises and therefore is not compatible with Microsoft Internet Explorer.
To build the game, you will need to install either:
PNPM is an alternative to NPM that is faster and more efficient. It is recommended to use PNPM for this project. You can install PNPM by following the instructions on their website: https://pnpm.io/installation
After installation, you can build the game by running the following commands in your terminal:
pnpm install
pnpm run build
Yarn is an alternative to NPM that is faster and more efficient. You can install Yarn by following the instructions on their website: https://yarnpkg.com/getting-started/install
After installation, you can build the game by running the following commands in your terminal:
yarn install
yarn run build
If you do not wish to use PNPM or Yarn, you can use NPM instead. You can install NPM by following the instructions on their website: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
After installation, you can build the game by running the following commands in your terminal:
npm install
npm run build
⚠️ If you are using NPM with a node version lower than 16.14: You will need to add the following to yourpackage.json
file under the "scripts" section:"preinstall": "npx npm-force-resolutions"
.
To run the game, simply open the index.html file in your favorite browser.
You can run the game locally using gulp with the following commands:
pnpm run start
or
pnpm install --global gulp-cli
gulp
You can pause by pressing [escape] and may retry levels by pressing [enter].
Use the arrow keys to navigate around the playing field.
1-9 keys all have functions
- Hard Mode (faster enemies, larger collision radius)
- Normal Mode (resets difficulty)
- Easy Mode (smaller collision radius)
- Wimp Mode (slower enemies, very small collision radius)
- God Mode (invulnerability)
- Blood Toggle (PEGI 13)
- Leave Trails (disable clearing before redraw)
- Pixelate (render at 1/4 resolution)
- 1-UP (for those stuck)
You can modify the levels and/or create new levels by changing the JSON files under the src/data directory.
JSON Schema's are provided to validate against in the /schemas directory.
After modification, you should rebuild the distribution build by using the gulp build
command in an NPM enabled terminal. (See 'How to Run Locally with Gulp' steps 1-4 above to install Gulp and dependencies)
Please refer to CHANGELOG.md for information on what has changed recently.
Application Code written by Tiernan Cridland.
Top Down Assets: Unlucky Studio: Top Down Car Sprites by Unlocky Studio
Udacity Assets: frontend-nanodegree-arcade-game