Files
endless-runner-vibe/Cargo.toml
Gabriel Kaszewski 65a5ba99c0 Apply code review improvements across all modules
Bugs fixed:
- Remove duplicate/corrupt draw_text in draw_active_effects_hud (screen_width as u8 = 0)
- Fix pickup-enemy avoidance using actual enemy center-x instead of platform midpoint
- Remove redundant `as f32` cast on an already-f32 expression

DRY / data coupling:
- Effect label and color now stored in each effect struct and passed from PickupDef::create_effect,
  eliminating the three-way duplication between Config, PickupEffectType, and ActiveEffect impls

Config-driven level gen:
- Add enemy_platform_margin and pickup_platform_margin fields to Config
- Replace magic number literals in level_gen with cfg fields

Encapsulation and code clarity:
- score_f made fully private; tests assert on the public score: u64
- Pickup::collected flag removed; collect_pickups uses retain for immediate removal
- Platform::top() and Enemy::top() removed (transparent aliases for .y); call sites use .y directly
- Game-over restart prompt now blinks at ~2 Hz using world.elapsed

Rust idioms:
- #[derive(Debug)] added to Player, Platform, Enemy, Pickup, PickupDef,
  PickupEffectType, Config, GameState, and all three effect structs
- [profile.release] added to Cargo.toml (lto=thin, codegen-units=1, panic=abort)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 00:21:44 +01:00

15 lines
236 B
TOML

[package]
name = "endless_runner"
version = "0.1.0"
edition = "2024"
[dependencies]
rand = "0.10.0"
raylib = { version = "5.5.1", features = ["wayland"] }
[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 1
panic = "abort"