Skip to content

adding some features#6

Open
DLtru wants to merge 1 commit into
Kasparsu:mainfrom
DLtru:main
Open

adding some features#6
DLtru wants to merge 1 commit into
Kasparsu:mainfrom
DLtru:main

Conversation

@DLtru
Copy link
Copy Markdown

@DLtru DLtru commented Mar 25, 2025

Golden Cookies:

  1. Added a random golden cookie event that appears with a 1% chance every second.
  2. When clicked, the golden cookie rewards the player with 500 cookies.
  3. The golden cookie appears visually on the screen and disappears once clicked.

Upgrades:

  1. Introduced an upgrades array to store upgrades that can be purchased.
  2. Each upgrade has a price and an associated effect. For example, the "Double Cookies" upgrade doubles the cookies per second (CPS).
  3. A button is displayed for each upgrade, which is enabled once the player has enough cookies to buy it.
  4. After purchasing an upgrade, the effect is applied, and a notification (alert) shows the player that the upgrade has been purchased.

Achievements:

  1. Created an achievements array to track milestones the player reaches, such as clicking a cookie, purchasing their first building, or earning 100 cookies.
  2. Each achievement has a goal (e.g., 100 cookies) and a flag (reached) that tracks whether the player has unlocked it.
  3. When the player meets the goal for an achievement, an alert pops up to notify them that the achievement has been unlocked.
  4. The achievements are displayed on the UI, showing either the current goal or the status of each achievement (unlocked or not).

Game State Persistence (using localStorage):

  1. Implemented saving and loading functionality using localStorage.
  2. Every 10 seconds, the game state (cookies, buildings, and upgrades) is saved to localStorage.
  3. When the game page is loaded, the saved state is retrieved and applied, ensuring that the player's progress is retained even after a page refresh.

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.

1 participant