Quick answer: Pygame rect.collidepoint missing clicks after camera scrolls? Click coordinates are screen-space; rect is world-space - subtract scroll offset from click before checking.
Inventory button works at scroll 0. Player scrolls down; click goes through the button.
Subtract scroll
world_pt = (click_x + scroll_x, click_y + scroll_y)
if rect.collidepoint(world_pt): ...Click event in screen-space; world position requires offset.
Or unscroll the rect
Render-time copy of the rect, scroll-adjusted. Compare against raw click. Either direction works.
Use a screen-fixed UI layer
UI elements drawn last in screen-space, never affected by scroll. Cleaner architecture.
“Screen-space and world-space don't mix without a transform.”
Build a small Camera class that owns the scroll transform. Every world-space query goes through it; the transform is correct everywhere.