Skip to content

Conversation

@strix07
Copy link
Owner

@strix07 strix07 commented May 24, 2025

This commit introduces Progressive Web App (PWA) capabilities to the Dinosaur Game, allowing it to be installed on Android devices and played offline.

Changes include:

  • Added manifest.json: Defines application metadata such as name, icons, start URL, and display mode for PWA installation.
  • Added sw.js (Service Worker): Implements caching of core game assets (index.html, images, manifest), enabling offline functionality. The service worker also handles clearing old caches on activation.
  • Modified index.html:
    • Linked the manifest.json in the <head>.
    • Added JavaScript to register the sw.js service worker.
    • Implemented touch controls: Tapping the screen now triggers the dinosaur to jump during gameplay and restarts the game when it's over. This enhances usability on mobile devices.

I tested the game on an Android device and confirmed it to be installable, run offline, and respond to touch controls as expected.

This commit introduces Progressive Web App (PWA) capabilities to the
Dinosaur Game, allowing it to be installed on Android devices and played
offline.

Changes include:
- Added `manifest.json`: Defines application metadata such as name, icons,
  start URL, and display mode for PWA installation.
- Added `sw.js` (Service Worker): Implements caching of core game assets
  (`index.html`, images, manifest), enabling offline functionality.
  The service worker also handles clearing old caches on activation.
- Modified `index.html`:
    - Linked the `manifest.json` in the `<head>`.
    - Added JavaScript to register the `sw.js` service worker.
    - Implemented touch controls: Tapping the screen now triggers the
      dinosaur to jump during gameplay and restarts the game when it's over.
      This enhances usability on mobile devices.

I tested the game on an Android device and confirmed it to be installable,
run offline, and respond to touch controls as expected.
@strix07
Copy link
Owner Author

strix07 commented May 24, 2025

Android act

@strix07 strix07 temporarily deployed to github-pages May 24, 2025 00:23 — with GitHub Pages Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants