Skip to content

Game#2

Open
GhostW1ng-Work wants to merge 24 commits into
mainfrom
Game
Open

Game#2
GhostW1ng-Work wants to merge 24 commits into
mainfrom
Game

Conversation

@GhostW1ng-Work
Copy link
Copy Markdown
Owner

No description provided.


private void Update()
{
transform.Translate(Vector3.left * _speed * Time.deltaTime);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Игрок двигается в пространстве а не препятствия на него

Comment thread Assets/Scripts/Player/CameraFollower.cs Outdated
Comment on lines +17 to +24
try
{
transform.position = new Vector3(_player.position.x, _player.position.y, transform.position.z);
}
catch (Exception error)
{
Debug.Log(error);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Зачем тут TryCatch?

Comment thread Assets/Scripts/Player/CameraFollower.cs Outdated
Debug.Log(error);
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Лишняя пустота

Comment thread Assets/Scripts/Player/Player.cs Outdated
public void AddCoin()
{
_coinsAmount++;
Debug.Log($"Coins Amount: {_coinsAmount}");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Убери все эти выводы в лог, не засоряй их мусором

Comment thread Assets/Scripts/Player/Player.cs Outdated

public class Player : MonoBehaviour
{
public UnityAction<int> OnCoinsAmountChanged;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Перечитай наши стандарты

Comment thread Assets/Scripts/Player/PlayerInput.cs Outdated
}
}

public void UpdateJumpInput()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Название метода не отражает суть

Comment thread Assets/Scripts/UI/PanelAnimator.cs Outdated
using UnityEngine;

[RequireComponent(typeof(Animator))]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Лишняя пустота

Comment thread Assets/Scripts/Coins/CoinsSpawner.cs Outdated
using System.Collections.Generic;
using UnityEngine;

public class CoinsSpawner : MonoBehaviour
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Дублирует спавнер препятствий

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Всё ещё дублирует

Comment thread Assets/Scripts/Coins/CoinsSpawner.cs Outdated
using System.Collections.Generic;
using UnityEngine;

public class CoinsSpawner : MonoBehaviour
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Всё ещё дублирует

Comment thread Assets/Scripts/Player/CameraFollower.cs Outdated
UpdateCameraPosition();
}

public void UpdateCameraPosition()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Почему он публичный?

Comment thread Assets/Scripts/Player/Player.cs Outdated

[SerializeField] private int _health;

private int _coinsAmount = 0;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

_coins

Comment thread Assets/Scripts/Player/Player.cs Outdated

public class Player : MonoBehaviour
{
public event UnityAction<int> CoinsAmountChanged;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment thread Assets/Scripts/Player/Player.cs Outdated

public class Player : MonoBehaviour
{
public event UnityAction<int> CoinsAmountChanged;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Придумай событию предметное название. Здесь скорей что CoinAdded

Comment thread Assets/Scripts/Player/PlayerInput.cs Outdated
_isGrounded = true;
}

public void UpdateHorizontalInput()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Название метода не соответствует содержанию

Comment thread Assets/Scripts/Player/PlayerInput.cs Outdated
Comment on lines +28 to +31
public void OnCollisionEnter2D()
{
_isGrounded = true;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Низкая надёжность у такого метода

Comment thread Assets/Scripts/Player/PlayerInput.cs Outdated
}
}

public void UpdateJumpInputAndCheckIsGrounded()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ужасающее название метода. И почему они опять публичные?

Comment thread Assets/Scripts/Player/PlayerMover.cs Outdated
ChangeVelocity(_rigidBody2D.velocity.x, _yVelocity);
}

public void ChangeVelocity(float xVelocity , float yVelocity)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Глагол Change ужасный

Comment thread Assets/Scripts/UI/CoinText.cs Outdated
_player.CoinsAmountChanged -= ChangeValue;
}

public void ChangeValue(int value)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Название метода слишком общее. Так 50% методов можно назвать ChangeValue


IEnumerator SpawnObstacles()
{
var waitForSecondsBetweenSpawn = new WaitForSeconds(_secondsBetweenSpawn);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

spawnDelay

Comment thread Assets/Scripts/UI/CoinText.cs Outdated
_player.CoinAdded -= ChangeCoinsAmount;
}

public void ChangeCoinsAmount(int coinsAmount)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

OnCoinAdded


public class CoinsSpawner : Spawner
{
private int _coinsCount = 0;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

_coins

StartCoroutine(SpawnObstacles());
}

IEnumerator SpawnObstacles()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

В чём смысл по разному реализовывать спавнер препятствий и спавнер монеток? А если их реализовать одинаково то будет дубляж, подумай как это всё обобщить

using UnityEngine;

[RequireComponent(typeof(Rigidbody2D))]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Лишняя пустая строка

SetVelocity(_rigidBody2D.velocity.x, _yVelocity);
}

private void SetVelocity(float xVelocity , float yVelocity)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Зачем?

Comment thread Assets/Scripts/Spawner.cs
Comment on lines +7 to +9
[SerializeField] protected GameObject _prefab;
[SerializeField] protected Transform[] _spawnPoints;
[SerializeField] protected float _secondsBetweenSpawn;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

protected полям это плохо ка ки пуб

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.

3 participants