-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Дубровин Алексей #10
base: master
Are you sure you want to change the base?
Дубровин Алексей #10
Conversation
🍅 Не пройден линтинг или базовые тесты |
🍏 Пройден линтинг и базовые тесты |
🍪 |
🍏 Пройден линтинг и базовые тесты |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Круто, пофиксить пару моментов и готово)
|
||
_save() { | ||
const value = [this._energy, this._happiness, this._hunger, this._volumeLevel].join('|'); | ||
document.cookie = `state=${value}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это, конечно, работает. Но в будущем для таких вещей лучше использовать localStorage.
|
||
sleep() { | ||
this._sleepId = setInterval(() => { | ||
this.energy++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Бодрость накапливается после смерти
hear() { | ||
this._hearId = setInterval(() => { | ||
this.happiness++; | ||
if (this.happiness === 100) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Продолжает слушать при 100
No description provided.