Devlog — UI: Added “Total reincarnation” at Moksha
Date: 2026-08-11
Commit: b6ab425
Author: pj90 (weirdcodesofficial)
Repo: weirdcodesofficial/MOKSHA — An HTML5 browser game based on Sanatan Shastras and Karmic philosophy.
Summary
Small UI change to the Moksha end screen: the total reincarnation count is now displayed when the player reaches Moksha. This improves feedback for players by showing how many lives/reincarnations they went through before attaining Moksha.
- Commit message: “UI: Added Total reincarnation at moksha.”
- Files changed:
src/engine.js(+1, -1) - What changed (conceptually): the Moksha end-screen HTML now inserts the reincarnation count before the credits.
What I changed (implementation note)
The end-screen composition previously appended only CREDIT. The change inserts the display for the reincarnation total (the COUNT_HTML) with two line breaks before the credits. In effect the end-screen string now includes the count, e.g. roughly:
'<br><br>' + COUNT_HTML + CREDIT;
The rest of the end logic (sound play vijaya) is unchanged.
Why
- Gives players a clear closure metric — how many reincarnations it took to reach Moksha — which is meaningful for a game built around karmic progress.
- Small, low-risk UX improvement that makes the ending feel more informative.
How to test
- Play the game until the Moksha end-screen triggers.
- Verify:
- The total reincarnation count is visible above the credits.
- Spacing looks good on desktop and mobile (the two
<br>s provide vertical separation). - No console errors (e.g.,
COUNT_HTMLundefined). - Existing end-screen sound still plays (
vijaya).
- Edge cases:
- If
COUNT_HTMLis empty or missing, the layout should still render gracefully. - Check for XSS or unescaped HTML if
COUNT_HTMLcan contain user data (it should be safe/static).
- If
Risks / Notes
- Styling: the inserted HTML uses raw breaks — consider replacing with a styled container (classed element) for better responsive control.
- Internationalization: ensure any text inside
COUNT_HTMLrespects translation/localization if needed. - Sanity check that
COUNT_HTMLis always defined and safe before concatenation.

Top comments (0)