Skip to content

fix: show turn phase indicator on mobile + fix tsc errors#6

Open
WiktorStarczewski wants to merge 6 commits intomainfrom
wiktor-fix-combat-mobile-show-box
Open

fix: show turn phase indicator on mobile + fix tsc errors#6
WiktorStarczewski wants to merge 6 commits intomainfrom
wiktor-fix-combat-mobile-show-box

Conversation

@WiktorStarczewski
Copy link
Owner

Summary

  • Show the turn phase indicator ("Choose your move", "Waiting for opponent...") on mobile — was previously hidden with hidden sm:block
  • Add src/vite-env.d.ts to resolve all import.meta.env TypeScript errors

Test plan

  • On mobile viewport, enter battle → verify phase indicator is visible above abilities
  • npx tsc --noEmit passes with zero errors

- Clamp death animation on last frame using LoopOnce so the model
  stays collapsed instead of looping
- Show KO'd champions in death pose during settle/second anim phases
  and outside animation phase when no survivors remain
- Track secondActed in AnimScript to avoid playing attack animation
  for champions KO'd before their turn
Port TypeScript combat engine to #![no_std] Rust in crates/combat-engine/.
Zero dependencies, fixed-point arithmetic, no heap allocation.

Modules: types, elements, champions, damage, codec, combat.
33 tests including full 3v3 battle integration test.
- Install cargo-miden v0.7.1, scaffold account + program templates
- Import combat-engine crate into Miden program, compile to .masp
- Execute 1v1 combat in Miden VM: output matches native Rust exactly
- Add resolve_turn_mut to combat-engine (Miden-friendly in-place variant)
- Discovered compiler bug: large struct returns silently miscompiled
- Workaround: inline combat logic instead of returning TurnResult
- Track findings in tasks/todo.md and tasks/lessons.md
- Arena account component (contracts/arena-account/) with 21-slot storage layout
- 6 procedures: join, set_team, submit_commit, submit_reveal, resolve_current_turn, claim_timeout
- Inlined combat resolution (all ability types, burn, buffs, team elimination)
- Champion state packing module (crates/combat-engine/src/pack.rs) with 7 native tests
- Compiler bug repro (contracts/combat-test-broken/) for Dennis
- SHA-256 verification, P2ID payouts, and block height access deferred as TODOs
- Builds to 381KB .masp, all 40 combat-engine tests pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant