Skip to content

React game#2

Open
AinuAnna wants to merge 11 commits intomainfrom
react-game
Open

React game#2
AinuAnna wants to merge 11 commits intomainfrom
react-game

Conversation

@AinuAnna
Copy link
Owner

@AinuAnna AinuAnna commented Mar 3, 2021

Task: https://github.com/rolling-scopes-school/tasks/blob/master/tasks/react/react-game.md
Screenshot:
image
Deploy: https://ainuanna.github.io/react-game-snake/
Deadline: 03.03.2021 Done: 03.03.2021
Score: 60/100

Basic scope +30

  • вёрстка, дизайн, UI. Выполняются требования к оформлению приложения +10
    эффекты анимации. Анимация ходов, перемещения фигур, допустимых и недопустимых ходов, начала и окончания игры, победы и поражения и т.д +10
  • механика игры. Ходы, перемещения фигур, набранные баллы, окончание игры и т.д. подчиняются определённым свойственным игре правилам +10

Advanced scope +30

  • музыка. В игре есть музыка, и есть настройка музыки: возможность вкл/откл музыку +10
  • сохранение игры при перезагрузке страницы. Сохраняется рекорд. Состояние игры сохраняется без необходимости кликать по кнопке save. Есть кнопка new game для запуска новой игры и stop game для остановки +10
  • возможность управления игрой с клавиатуры или не меньше пяти hot keys. Есть список горячих клавиш для управления игрой с клавиатуры +10 (D,S,A,W,DOWN,UP,LEFT,RIGHT)

@AinuAnna AinuAnna temporarily deployed to react-game-snake March 3, 2021 13:39 Inactive
@AinuAnna AinuAnna requested a review from MSt1ch March 7, 2021 13:19
let min = 1;
let max = 98;
let x = Math.floor((Math.random() * (max - min + 1) + min) / 2) * 2;
let y = Math.floor((Math.random() * (max - min + 1) + min) / 2) * 2;
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggest you use permanent variables like const if you never changed them.

}

render() {
console.log(this.state.status);
Copy link
Collaborator

Choose a reason for hiding this comment

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

unnecessary code

import React, { useState, useEffect } from 'react';

const useAudio = (url) => {
const [audio] = useState(new Audio(url));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's check the documentation about theuseState hook.

color: #ff0000;
justify-content: space-around;
}
.startgame {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest you use the same notation dash or camel case

margin-left: 30px;
width: 150px;
}
#GameOverText {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest you avoiding ID in CSS

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