Add Space Invaders Nouveau: a full PWA recreation with Art Nouveau st…#347
Open
rubyrayjuntos wants to merge 2 commits into
Open
Add Space Invaders Nouveau: a full PWA recreation with Art Nouveau st…#347rubyrayjuntos wants to merge 2 commits into
rubyrayjuntos wants to merge 2 commits into
Conversation
…yling Implements the complete spec: requestAnimationFrame game loop with a finite-state machine (attract/play/game-over), hive-mind alien swarm with hardware-accurate speed-up, deterministic Rolling/Plunger/Squiggly alien firing patterns, hidden shot-count-based UFO scoring table, and pixel-level destructible bunkers via off-screen canvas + ImageData. Reskins the classic in a gilded, jewel-toned Art Nouveau visual language (vector-drawn stained-glass aliens, whiplash-curve backdrops, ornamental frame) with all sound effects procedurally synthesized via the Web Audio API rather than sampled. Includes mobile touch controls gated on pointer:coarse, a web app manifest, and a cache-first service worker for offline play.
There was a problem hiding this comment.
Pull request overview
Adds a complete, dependency-free Space Invaders “Nouveau” Progressive Web App under space-invaders/, including an offline-capable service worker, web app manifest, and a full Canvas/WebAudio implementation with a finite-state game loop.
Changes:
- Introduces a finite-state-machine game loop (attract/play/game-over) with core gameplay entities (swarm, player, bullets, bunkers, UFO) and collision handling.
- Adds a full Art Nouveau rendering layer (vector-drawn sprites, background, ornamental frame) plus procedural sound synthesis via Web Audio.
- Implements PWA packaging:
manifest.webmanifest, cache-firstsw.js, icons, and a staticindex.html+ CSS UI including touch controls.
Reviewed changes
Copilot reviewed 23 out of 27 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| space-invaders/index.html | Game shell markup (HUD/canvas/touch controls) and module entrypoint. |
| space-invaders/css/style.css | Responsive styling and touch-control layout for mobile. |
| space-invaders/manifest.webmanifest | PWA metadata (name/theme/icons/scope). |
| space-invaders/sw.js | Cache-first service worker and precache list for offline play. |
| space-invaders/README.md | Local run instructions and control summary. |
| space-invaders/icons/icon.svg | App icon (SVG). |
| space-invaders/js/game.js | Main game orchestration, RAF loop, and state machine wiring. |
| space-invaders/js/constants.js | Centralized gameplay/rendering constants and palette. |
| space-invaders/js/input.js | Unified keyboard/touch input handler with edge-triggered fire. |
| space-invaders/js/audio.js | Procedural SFX generation and playback manager. |
| space-invaders/js/render.js | Canvas rendering for aliens/explosions/background/frame. |
| space-invaders/js/collision.js | Broad/narrow-phase collisions + effects and bullet resolution. |
| space-invaders/js/state/stateMachine.js | Minimal state machine for attract/play/game-over flow. |
| space-invaders/js/state/attractState.js | Title/legend screen and new-game transition. |
| space-invaders/js/state/playState.js | Core gameplay update/render and wave/life transitions. |
| space-invaders/js/state/gameOverState.js | Game-over screen, delay, and restart transition. |
| space-invaders/js/entities/alien.js | Alien model (type/points/size). |
| space-invaders/js/entities/swarm.js | Swarm hive-mind movement, stepping cadence, and rendering. |
| space-invaders/js/entities/alienFireController.js | Deterministic-pattern alien firing controller. |
| space-invaders/js/entities/player.js | Player movement, firing, and vector-rendered ship. |
| space-invaders/js/entities/bullet.js | Player/alien bullet behavior and rendering. |
| space-invaders/js/entities/bunker.js | Offscreen-canvas bunkers with pixel-destructible damage. |
| space-invaders/js/entities/explosion.js | Lightweight explosion particle entity. |
| space-invaders/js/entities/mysteryShip.js | UFO spawn/loop and shot-count-based scoring. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <canvas id="game-canvas" width="224" height="256"></canvas> | ||
| </div> | ||
|
|
||
| <div id="touch-controls" aria-hidden="true"> |
Comment on lines
+21
to
+24
| reset() { | ||
| this.timer = 0; | ||
| this.nextInterval = this._randomInterval(); | ||
| } |
Comment on lines
+11
to
+23
| transition(name) { | ||
| if (this.current && this.states[this.current].exit) this.states[this.current].exit(); | ||
| this.current = name; | ||
| if (this.states[this.current].enter) this.states[this.current].enter(); | ||
| } | ||
|
|
||
| update(dt) { | ||
| this.states[this.current].update(dt); | ||
| } | ||
|
|
||
| render(ctx) { | ||
| this.states[this.current].render(ctx); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…yling
Implements the complete spec: requestAnimationFrame game loop with a finite-state machine (attract/play/game-over), hive-mind alien swarm with hardware-accurate speed-up, deterministic Rolling/Plunger/Squiggly alien firing patterns, hidden shot-count-based UFO scoring table, and pixel-level destructible bunkers via off-screen canvas + ImageData.
Reskins the classic in a gilded, jewel-toned Art Nouveau visual language (vector-drawn stained-glass aliens, whiplash-curve backdrops, ornamental frame) with all sound effects procedurally synthesized via the Web Audio API rather than sampled. Includes mobile touch controls gated on pointer:coarse, a web app manifest, and a cache-first service worker for offline play.