Devlog — commits 8fba4cc3 & 2cb9fee7
Date: 2026-08-14
Repo: weirdcodesofficial/MOKSHA — "An HTML5 browser game based on Sanatan Shastras and Karmic philosophy."
Primary languages: JavaScript (≈89%), CSS, HTML
Summary (high level)
- Gameplay: praarabdha (accumulated karmic debt) now directly increases in-game speed (gati), making gameplay harder as praarabdha grows. The new formula is linear:
1 + this.praarabdha. - UI/UX: the "gatee" HUD now pulsing/glowing purple when praarabdha > 0; renderer draws a purple pulsing ring when praarabdha is active.
- Internal: simplified praarabdha bookkeeping — older multiplicative snapshot logic removed in favor of a single penalty multiplier.
- Risk: a naming inconsistency (typo) was introduced which can break initialization/reset behavior — needs quick fix.
Detailed changes by file / intent
src/engine.js
- Removed older fields:
-
praarabdhaGatiModifier,_bhogGatiSnapshot
-
- Added / used:
-
praarabdhaPenaltyMul(initialization) but code usespraarabdhaPenaltiMul(missing 'y') — naming inconsistency.
-
- New penalty computation in main loop:
const praarabdhaPenaltiMul = 1 + this.praarabdha;- This multiplier scales:
-
samayadepletion - star and tunnel sparkle movement
-
mayamovement speed - HUD warp display (gatee)
-
reset()updated to init the penalty variable.
src/karma.js
- Death/rebirth handling simplified:
- Instead of multiplying an accumulated gati modifier, it sets a penalty snapshot once:
if (prevPraarabdha === 0) { this.praarabdhaPenaltiMul = Math.max(0.01, this._currentGatiModifier); }- Ashuvha/shuvha karma reset and punarjanma increment remain.
src/render.js
- Adds a purple pulsing ring / glow around gati indicator when
praarabdha > 0. - Engine also sets
gateeDOM color & text-shadow to purple when praarabdha active.
Behavioral / design notes & risks
- Scaling change:
- Previous implementation: exponential scaling with cap (approx.
Math.pow(1.15, praarabdha)capped at ~3×). - New implementation: linear scaling
1 + praarabdha(no cap). - Risk: without a cap or sub-linear scaling, large
praarabdhavalues can make gameplay unreasonably fast/hard. - Recommendation: consider adding a cap (e.g.,
Math.min( MAX_PENALTY, 1 + praarabdha * k )) or using sub-linear scaling (1 + Math.sqrt(praarabdha) * k).
- Previous implementation: exponential scaling with cap (approx.
- Naming inconsistency (urgent):
- Constructor/reset assigns
this.praarabdhaPenaltyMul = 1.0;(with "y"). - Later code and karma logic use
this.praarabdhaPenaltiMul(missing "y") and localconst praarabdhaPenaltiMul. - Consequence: the initial property may not be read by the runtime code, causing incorrect initialization or resets.
- Action: unify the name across all files (
praarabdhaPenaltyMulrecommended) and update all references.
- Constructor/reset assigns
Quick checklist for testing & validation
- Playtest with praarabdha values: 0, 1, 2, 5, 10:
- Observe samaya depletion, star/sparkle movement, maya speed.
- Verify the HUD "gatee" numeric value and purple glow behavior.
- Boundary tests:
-
praarabdha = 0→ no purple glow, normal speeds. -
praarabdha = 1..5→ check difficulty increase for fairness. -
praarabdha ≥ 10→ confirm game remains playable; if not, add a cap.
-
- Reset / rebirth flows:
- Confirm penalty resets correctly on
reset(). - Confirm
if (prevPraarabdha === 0)logic behaves as intended (is snapshot-only-on-first-praarabdha desired?).
- Confirm penalty resets correctly on
- Regression tests:
- Smoke test render to ensure glow ring draws correctly and doesn't affect unrelated canvas state.
- Unit/integration test for
reset()ensurepraarabdhaPenaltyMul === 1.0after reset.
Suggested fixes / next steps
- Fix naming inconsistency
- Choose one property name (suggestion:
praarabdhaPenaltyMul) and replace all occurrences in:src/engine.jssrc/karma.js- any other files referencing the penalty
- Add a small comment describing semantics and default.
- Choose one property name (suggestion:
- Re-evaluate scaling
- Add a cap or softer curve, for example:
const praarabdhaPenalty = Math.min(MAX_PENALTY, 1 + this.praarabdha * K);- Or
1 + Math.sqrt(this.praarabdha) * K
- Tune
KandMAX_PENALTYby playtesting.
- Add a cap or softer curve, for example:
- Safety & tests
- Add assertion or unit test:
reset()sets penalty to1.0. - Add a playtest checklist and short notes on acceptable difficulty boundaries.
- Add assertion or unit test:
- Optionally, propose a small PR:
- Rename/cleanup property, add cap parameter, and include a short test or comments.
Changelog entry (short)
- UX: praarabdha now increases game speed linearly, making gameplay harder with accumulated praarabdha.
- UI: gati/gatee HUD now pulses purple while praarabdha is active.
- Internal: simplified praarabdha bookkeeping (replaced multiplicative snapshot accumulation with single penalty multiplier).
Top comments (0)