/exchanges-puzzle-game

A game of trading and combining items with a spy theme.

Primary LanguageJavaScriptBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Exchanges Puzzle Game

A game of trading and combining. This distills the "item trading puzzles" you see in many adventure titles down to it's purest form. You'll only need the main mouse button and/or a finger for your touchscreen:

  • Click / Tap
    • to focus on an item
    • to combine the focused item with another
  • Held Click / Long Press
    • to ask NPCs what they want
  • Alternatively, drag-then-drop to focus-then-combine in one action.

This was an entry for the Linux Game Jam 2018, and is hosted on itch.io

Development

Icons were drawn with Krita and exported to SVG, Levels are defined as JSON files. There is a script that packages up the game with NWJS, but it's only setup to produce an Ubuntu package file and not for other OSes. Since there's only one CSS file and one HTML file, they live at the root, no need for subfolders. Polyfills were used for mobile drag 'n drop. native HTML dialogs and fullscreen support.

Web Features

This project was an exercise in developing a modern web project with no frameworks and as many useful features as all platforms now support. In that vein, here's the web platform features I was particularly interested in getting to use, originally based on this document:

  • Web App Manifest
  • Semantic elements
  • SVG images
  • System UI Font
  • CSS Variables
  • Scalable CSS Units instead of fixed pixels
  • Grid and Flexbox
  • Native Dialog (with polyfill)
  • JS modules
  • JS classes
  • Drag and Drop
  • Touch-Friendly: Tap vs Long Press detection
  • JS LocalStorage
  • FullScreen API
  • JS Promises
  • JS Fetch API (replaces XMLHttpRequest)
  • JS Arrow Functions

Additionally, ESLint was used to double-check the code.

P.S.

If you attempt to open the html file instead of using a server, the levels will not load.