Skip to content

Adding features#3

Open
lokr3m wants to merge 2 commits into
Kasparsu:mainfrom
lokr3m:main
Open

Adding features#3
lokr3m wants to merge 2 commits into
Kasparsu:mainfrom
lokr3m:main

Conversation

@lokr3m
Copy link
Copy Markdown

@lokr3m lokr3m commented Mar 21, 2025

1. Golden Cookies

  • Spawn chance: 5% every 10 seconds.
  • Duration: 5 seconds.
  • Reward: 10% of the current cookies + 50 cookies.
  • Appears at a random position on the screen.

How it works:

  • Every 10 seconds, there's a 5% chance a golden cookie will appear.
  • If the player clicks on it within 5 seconds, they receive the bonus.
  • The golden cookie disappears after being collected or when time runs out.

2. Achievements

  • Automatically checked every time cookies are updated.
  • When an achievement is unlocked, it appears as a popup notification.
  • The notification disappears after 3 seconds.

Examples of achievements:

  • 100 Cookies! – Earn 100 cookies.
  • 1,000 Cookies! – Earn 1,000 cookies.
  • First Building! – Buy your first building.
  • Golden Collector! – Collect 5 golden cookies.

3. Upgrades

  • Available for purchase using cookies.
  • Each upgrade can be purchased only once.
  • Upgrades modify game mechanics (e.g., increase production, reduce prices).

Examples of upgrades:

  • Better Cursors (500 cookies) – Doubles cursor production.
  • Cheaper Buildings (1,000 cookies) – Reduces the price of all buildings by 10%.

Comment thread src/pages/CookieClicker.vue Outdated
@lokr3m
Copy link
Copy Markdown
Author

lokr3m commented Mar 23, 2025

Resolving some issues:

  • You can add a new, cheaper building – it will automatically be placed at the beginning of the list.
  • Upgrades work correctly – they always apply to the cheapest building.
  • Building prices are recalculated correctly – purchasing increases the price, but sorting maintains the correct order.
  • Flexibility and scalability – no need to change the code when adding new buildings in the future.

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.

2 participants