Skip to content

Code refactoring#36

Open
Skiedas wants to merge 1 commit into
HolyMonkey:masterfrom
Skiedas:Refactoring
Open

Code refactoring#36
Skiedas wants to merge 1 commit into
HolyMonkey:masterfrom
Skiedas:Refactoring

Conversation

@Skiedas
Copy link
Copy Markdown

@Skiedas Skiedas commented Mar 1, 2021

No description provided.

transform.position = Vector3.MoveTowards(transform.position, _target, _speed * Time.deltaTime);
}

private void SetNextTarget()
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.

NextTarget


private void SetNextTarget()
{
_target = Random.insideUnitCircle * 4;
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.

4 - магическое число

using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
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.

Подумай как будет работать бустер если подобрать несколько подряд. Работать должно нормально

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, X5
А потом уменьшаться
X5, X4, X3, X2

{
if (collider.TryGetComponent(out Enemy enemy))
{
enemy.Dying();
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.

Die()

Comment on lines +17 to +27
if (Input.GetKey(KeyCode.W))
_playerMover.Move(Vector3.up);

if (Input.GetKey(KeyCode.S))
_playerMover.Move(Vector3.down);

if (Input.GetKey(KeyCode.A))
_playerMover.Move(Vector3.left);

if (Input.GetKey(KeyCode.D))
_playerMover.Move(Vector3.right);
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.

GetAxis

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