Runner sun, Snake bonus star and Stack previews allocate every frame
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- game-dev, performance
Línea de trabajo
Read the render paths in games/runner/scenes/GameScene.ts and games/snake/scenes/GameScene.ts, then inspect drawMini in games/stack/scenes/GameScene.ts. Compare the per-frame allocations with the suggested caching or reuse approaches in the issue. Run npm test and use npm run dev to check the three screens; done means all three paths avoid per-frame allocations while their visuals stay unchanged.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
Three render paths allocate new objects on every frame for values that do not change from frame to frame. Each one is small, but together they add steady garbage on phones.
Where
games/runner/scenes/GameScene.ts(render, the synthwave sun): each frame builds twoPhaser.Display.Colorobjects withValueToColorand interpolates a third for each of the 12 sun bands, although the band colors never change.games/snake/scenes/GameScene.ts(starPoints, called fromrenderwhile a bonus star is up): a new array of 10Phaser.Math.Vector2each frame.games/stack/scenes/GameScene.ts(drawMini): for the hold piece and every next-piece preview, each frame builds a cell array and four mapped arrays forMath.min/Math.max, although a piece type's preview layout never changes.
Details
Runner's sun, for example:
const c = Phaser.Display.Color.Interpolate.ColorWithColor(
Phaser.Display.Color.ValueToColor(NEON.yellow),
Phaser.Display.Color.ValueToColor(NEON.pink),
11,
i,
);
Impact
Low. This is extra minor-GC pressure for as long as each screen is up. It is the same class of cost as the items in #107.
Suggested fix
- Runner: compute the 12 band colors once into a module constant.
- Snake: reuse one points array and set its entries in place, or bake the star once (the rotation could then be the Image's rotation).
- Stack: cache each piece type's preview cells and offsets in a
Mapthe first time it is drawn.
Acceptance criteria
- None of the three paths allocates per frame.
- Visuals are unchanged.
Getting started
- Relevant files: the three scenes above
- How to run tests:
npm test; run a game withnpm run dev
Related: #107
Filed by repo-audit/fix-issues at b2a3ff6. Severity: low. Effort: S. audit-key: performance|games/runner/scenes/GameScene.ts|sun-colors
- Lenguaje dominante
- TypeScript
- Estrellas
- 3
- Forks
- 3
- Merge medio
- 10 h 22 min
- PR fusionados (30 d)
- 6
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TMHSDigital/GH-Arcade
-
enhancement help wanted severity: low
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
TMHSDigital/GH-Arcade#139 ·
Los mantenedores suelen responder en 1 día
-
enhancement help wanted severity: medium
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
TMHSDigital/GH-Arcade#127 ·
Los mantenedores suelen responder en 1 día
-
enhancement help wanted severity: medium
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
TMHSDigital/GH-Arcade#126 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Add a game speed assist settingAbiertoaccessibility enhancement severity: low
Dificultad 4/5 3-5 días Aptitud para principiantes 40/100
TMHSDigital/GH-Arcade#114 ·
Los mantenedores suelen responder en 1 día
-
enhancement severity: low
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
TMHSDigital/GH-Arcade#113 ·
Los mantenedores suelen responder en 1 día
Todos los issues de TMHSDigital/GH-Arcade
Issues similares
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
microsoft/playwright#44289 ·
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 2/5 Medio día Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
blamechris/chroxy#9272 ·
Los mantenedores suelen responder en 1 día
-
no-repo-link tool-submission
Dificultad 1/5 Menos de una hora Aptitud para principiantes 66/100
BraveOPotato/NoSignups#2458 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
drmrd/vernacular#1061 ·
Los mantenedores suelen responder en 1 día