Skip to content

refactor: modularize codebase, integrate clap cli, and optimize release build - #1

Open
Jacob-Dayan wants to merge 9 commits into
CodeWithCompound:mainfrom
Jacob-Dayan:main
Open

Jacob-Dayan wants to merge 9 commits into
CodeWithCompound:mainfrom
Jacob-Dayan:main

Conversation

@Jacob-Dayan

Copy link
Copy Markdown

What did I just do?

Took a completely innocent, 2001-looking bouncing dot toy and treated it like a AAA engine that desperately needed an enterprise architecture overhaul.

The Damage

  • Modular "Architecture": Split src/main.rs into src/lib.rs because obviously CuteDot and an enum that cycles through 5 colors needed their own crate boundaries. Also gave CuteDot a Default implementation and a .draw() method so it feels like real software.
  • Enterprise CLI with clap: You can now pass --dev-mode from your terminal. Why click a toggle in the settings menu like a peasant when you can launch straight into the FPS counter from bash?
  • Nuclear Release Optimizations: Slapped lto = "fat", codegen-units = 1, panic = "abort", and strip = true into Cargo.toml. Those 20 bouncing circles are now running on bare metal with zero mercy.
  • Dynamic Versioning: Sourced the version string straight from CARGO_PKG_VERSION instead of hardcoding "0.2.3" like an amateur. Bumped to 0.2.4.
  • Bureaucracy: Threw in an MIT LICENSE and completely rewrote the README.md to document our revolutionary "I click button, I happy" gameplay loop.

How to verify this madness

cargo run -- --dev-mode

Smash the dots + button until your fans spin up.

…, add clap to dependencies for CLI parsing, and fix cargo-clippy package name warning
Begin modularizing main.rs by offloading core game state, color, and
dot definitions to `simple_menu`. Introduce `clap` for command-line
argument parsing and clean up inline formatting.

This commit lays the groundwork; remaining module integrations and
cleanup will follow in subsequent commits.
@Jacob-Dayan
Jacob-Dayan force-pushed the main branch 4 times, most recently from 888a09c to 9cd024d Compare October 3, 2026 10:27
…as an unedited template (Mine is no less than PEAK).
Swapped spaghetti boundary checks for proper Rect methods, taught dots how to update themselves, and cleaned up the UI logic. Still completely unnecessary for bouncing 20 circles, but at least the code looks like someone with a plan wrote it.
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