Skip to content

FirstVersion#41

Open
GhostW1ng-Work wants to merge 2 commits into
HolyMonkey:masterfrom
GhostW1ng-Work:FirstRefactoring
Open

FirstVersion#41
GhostW1ng-Work wants to merge 2 commits into
HolyMonkey:masterfrom
GhostW1ng-Work:FirstRefactoring

Conversation

@GhostW1ng-Work
Copy link
Copy Markdown

No description provided.

Comment on lines +7 to +8
[SerializeField] private float _time;
private void OnTriggerEnter2D(Collider2D collision)
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.

Отдели пустой строкой

Comment on lines +28 to +35
public void Boost(float boostTime)
{
_speed += _defaultSpeed;
if (_coroutine == null)
{
_coroutine = StartCoroutine(StartChangeSpeed(boostTime));
}
}
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.

Бустеры должна накапливаться по другому принципу.

X2,X3,X4....X3,X2

Т.е каждый бустер просто увеличивает скорость на своё время, несколько бустер могут сумироваться но при этом у каждого бустера свой таймер окончания. Когда параллельно допустим 3 бустера, один может закончится и параллельно будет работать 2 бустера

Comment thread Assets/Group1/Scripts/PlayerMover.cs Outdated

private IEnumerator StartChangeSpeed(float boostTime)
{
var waitForOneSeconds = new WaitForSeconds(boostTime);
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.

В этой переменной нет смысла

Comment thread Assets/Group1/Scripts/PlayerMover.cs Outdated
private IEnumerator StartChangeSpeed(float boostTime)
{
var waitForOneSeconds = new WaitForSeconds(boostTime);
while (_speed != _defaultSpeed)
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.

В этом цикле нет смысла

Comment thread Assets/Group1/Scripts/PlayerMover.cs Outdated
EndChangeSpeed(_coroutine);
}

private void EndChangeSpeed(Coroutine coroutine)
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.

Глупый метод

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