Add player-centered viewport scrolling for variable map sizes
Window size is now fixed (840×524) and independent of map dimensions. Small maps center in the viewport; maps larger than the viewport keep the player centered and clamp at board edges so no empty space shows. Also derives Copy+Clone on Player to enable the per-frame origin calculation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -190,6 +190,7 @@ pub struct PortalDef {
|
||||
/// the player will eventually become a scripted object that responds to
|
||||
/// input events, at which point this struct may be removed or made optional.
|
||||
/// See `ARCHITECTURE.md` for details.
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Player {
|
||||
/// Column position (0-indexed, increasing rightward).
|
||||
pub x: i32,
|
||||
|
||||
Reference in New Issue
Block a user