Neon Maze: a catch on the tick the last dot is eaten clears the level without losing a life

Aberta Para iniciantes
#104 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
72/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
typescript
Domínio
game-dev

Direção de pesquisa

Comece em games/maze/scenes/GameScene.ts, em tick() por volta das linhas 419-427, onde checkCatches() roda antes de clearLevel(). Depois leia die() e clearLevel() perto das linhas 460-482 para ver como a fase é sobrescrita, e update() perto da linha 196 para ver onde afterDeath() é executado. Está concluído quando uma captura no frame em que o último ponto é comido custa uma vida e não avança o nível; execute npm test e adicione uma verificação para esse caso se a suíte tiver um harness para isso.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

bug good first issue severity: low

Summary

In Neon Maze, if a chaser catches the runner on the same tick that the last dot is eaten, the level clears and the life is never lost.

Where

  • games/maze/scenes/GameScene.ts:419-427 (tick: checkCatches() then if (this.dots.size === 0) this.clearLevel())
  • games/maze/scenes/GameScene.ts:460-462, :480-482 (die() sets phase 'dying', clearLevel() overwrites it with 'clearing')
  • games/maze/scenes/GameScene.ts:196-204 (update only calls afterDeath(), which takes the life, from 'dying')

Details

tick() moves the runner (eating the dot), moves the chasers, then calls checkCatches(), which can call die(). It then goes on to clearLevel() with no phase check, so the 'dying' phase is replaced by 'clearing' and afterDeath() never runs.

Impact

Rare and in the player's favour: the death effects play over a level clear, no life is lost, and the run can be credited with a clear (and the maze.clear trophy) it should not have.

Steps to reproduce

  1. Leave one dot next to a chaser's path.
  2. Eat it just as an unscared chaser reaches the runner.
  3. The death burst plays, then the next level starts with the same lives.

Suggested fix

In tick(), return after checkCatches() if the phase is no longer 'play', or check this.phase === 'play' before calling clearLevel().

Acceptance criteria

  • A catch on the frame of the last dot costs a life and does not advance the level.

Getting started

  • Relevant files: games/maze/scenes/GameScene.ts
  • How to run tests: npm test

Filed by repo-audit/full-audit at de2b25b. Severity: low. Effort: S. audit-key: bug|games/maze/scenes/GameScene.ts|tick

Linguagem predominante
TypeScript
Estrelas
3
Forks
3
Merge médio
8h 13min
PRs com merge (30d)
2

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/GH-Arcade

Todas as issues de TMHSDigital/GH-Arcade

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.