Skip to content

add autosave, add gradma pic after buying it#2

Open
SQtatdev wants to merge 3 commits into
Kasparsu:mainfrom
SQtatdev:main
Open

add autosave, add gradma pic after buying it#2
SQtatdev wants to merge 3 commits into
Kasparsu:mainfrom
SQtatdev:main

Conversation

@SQtatdev
Copy link
Copy Markdown

@SQtatdev SQtatdev commented Mar 20, 2025

Added autosave only for Cookie
Added grandama pick (not nude) appearance only after buying

Automatic display of pictures
For each building: 1 + (number / 10) pictures (every +10 buildings = +1 picture).

Flexible layout
Pictures are moved to new lines when there is not enough space (is-flex-wrap-wrap).

Optimizations
Unique keys for v-for

Removed unnecessary calculations
Refresh cookies every 0.1 sec instead of 1 sec

Fixes
Check if cookies are sufficient before purchase

Formatting numbers (1_000 instead of 1000)

Visual
Added indents between elements (m-2, mb-3).

By help of AI)))))

Comment thread src/pages/CookieClicker.vue Outdated
{ name: 'Grandma', price: 100, cps: 1, count: 0},
{ name: 'Farm', price: 1000, cps: 10, count: 0},
{ name: 'Factory', price: 10_000, cps: 100, count: 0},
{ name: 'Factory', price: 100000, cps: 100, count: 0},
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to leave _ in between as this is used to make it easier to understand big numbers. _ itself does nothing but you can more easier understand wether it is 10k or 100k

Comment thread src/pages/CookieClicker.vue Outdated
cps+=building.cps*building.count;
});
return cps;
// Автосохранение
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me and most of worlds population does not understand this comment. All code is supposed to be in english since it is universally accepted language.

Comment thread src/pages/CookieClicker.vue Outdated
{ name: 'Farm', price: 1000, cps: 10, count: 0},
{ name: 'Factory', price: 10_000, cps: 100, count: 0},
{ name: 'Factory', price: 100000, cps: 100, count: 0},
{ name: 'Factory upgrade', price: 1000000, cps: 1000, count: 0}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really an upgrade is it if its under the buildings and does the same thing

const saveGameState = () => {
const gameState = {
cookies: cookies.value,
buildings: buildings.value.map(b => ({
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you mapping this to exact same structure?

if (savedData) {
const parsedData = JSON.parse(savedData);
cookies.value = parsedData.cookies || 0;
buildings.value = buildings.value.map(b => {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again if you saved it shouldn't it still be same?

Comment thread src/pages/CookieClicker.vue Outdated

setInterval(() => {
cookies.value += cps.value;
cookies.value += cps.value / 10;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay we do this 10 times more so give 10 times less cookies but why? we could also do this every 1 ms and give 1000 times less cookies? Can you come up with idea why it would be bad idea?

@SQtatdev
Copy link
Copy Markdown
Author

SQtatdev commented Apr 3, 2025 via email

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