DEV Community

Cover image for Added “Total reincarnation” at Moksha
Weird Codes
Weird Codes

Posted on • Originally published at weirdcodes.itch.io

Added “Total reincarnation” at Moksha

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.

punarjanma-info

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

  1. Play the game until the Moksha end-screen triggers.
  2. 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_HTML undefined).
    • Existing end-screen sound still plays (vijaya).
  3. Edge cases:
    • If COUNT_HTML is empty or missing, the layout should still render gracefully.
    • Check for XSS or unescaped HTML if COUNT_HTML can contain user data (it should be safe/static).

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_HTML respects translation/localization if needed.
  • Sanity check that COUNT_HTML is always defined and safe before concatenation.

Top comments (0)