Add invariant tests for maze, runner, pinball and siege data tables

Ouverte
#32 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
55/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
typescript
Domaine
game-dev, testing-qa

Piste de recherche

Start by reading the listed tables in games/maze/maze.ts, games/maze/config.ts, games/runner/patterns.ts, and games/pinball/table.ts, then check how games/runner/scenes/GameScene.ts consumes runner patterns. games/siege/sprites.ts imports Phaser, so its data needs a Phaser-free home before Node can load it. Add checks for the listed invariants and make them pass in CI; the issue notes there is no test suite yet.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

severity: low testing

Summary

Hand-edited ASCII and coordinate tables depend on constants defined elsewhere. A one-character typo compiles cleanly and only shows up in play: a chaser stuck in the house, an unreachable dot, or a Runner crash on an empty pattern pool.

Where

  • games/maze/maze.ts:8-72, games/maze/config.ts:8-9, games/maze/config.ts:46
  • games/runner/patterns.ts:31-45, games/runner/scenes/GameScene.ts:293-300
  • games/pinball/table.ts:19-86
  • games/siege/sprites.ts:1, games/siege/sprites.ts:8-31 (imports Phaser, so its data cannot be loaded in node)

Suggested fix

Maze

  • MAZE has ROWS rows of length COLS, each a palindrome
  • wrapX wraps both edges; the tunnel row is open at both ends
  • The door cell is not open; the house exit and bonus cell are open
  • Exactly 4 power cells; dot count exceeds the highest bonus threshold
  • A flood fill from the player start reaches every dot and power cell

Runner

  • At least one pattern has minLevel 0; all minLevel values are within the level cap
  • Every piece lies within its pattern length; solid pieces do not overlap

Pinball

  • All coordinates are finite; arch segments share endpoints and join the side walls
  • Flipper pivots are symmetric; target and lane counts match the trophy text

Siege

  • Move the art and scoring tables to a Phaser-free module, then assert equal-width rows, matching frame sizes and a points value for every row kind

Acceptance criteria

  • The cases above pass in CI

Getting started

  • Relevant files: games/maze/maze.ts, games/maze/config.ts, games/runner/patterns.ts, games/pinball/table.ts, games/siege/sprites.ts
  • Run locally: npm install, then npm run dev
  • Checks: npm run typecheck and npm run build (there is no test suite yet)
  • Related docs: README.md

Filed by repo-audit/full-audit at b001f5d. Severity: low. Effort: M. audit-key: testing|games/maze/maze.ts|MAZE

Langage dominant
TypeScript
Étoiles
3
Forks
3
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/GH-Arcade

Toutes les issues de TMHSDigital/GH-Arcade

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.