Skip to content

[REFACTOR] Centralize game logic and constants #4

@MrJacob12

Description

@MrJacob12

There is significant logic duplication across the codebase. Hardcoded values for pack
unlock requirements, income multipliers, and upgrade costs are defined in multiple
places (e.g., gameStore.ts and PackOpening.tsx). This makes the game difficult to
balance and prone to bugs.

Tasks:

  • Create a centralized configuration file at src/config/gameConfig.ts.
  • Extract pack requirements, upgrade cost formulas, and base multipliers into the
    config file.
  • Implement a unified calculateCurrentIncome(state) helper function to be used for
    both offline and active income calculations.
  • Refactor gameStore.ts and PackOpening.tsx to consume these shared constants and functions.

Metadata

Metadata

Assignees

Labels

REFACTORImproving code structure without changing application behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions