Skip to content
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

feat(HW2) #16

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

feat(HW2) #16

wants to merge 4 commits into from

Conversation

chaeminseok1234
Copy link
Contributor

변경점 👍

새로 구현한 기능 및 주요 변경점
단검 공격 구현

버그 해결 💊

해결한 버그

리팩토링 🛠

리팩토링 내역

스크린샷 🖼

변경된 부분에 대한 스크린샷

비고 ✏

리뷰어에게 전하는 말 등


사용하지 않은 항목은 모두 지워주세요.

@chaeminseok1234 chaeminseok1234 self-assigned this Nov 3, 2024
Copy link

@Gimlocal Gimlocal left a comment

Choose a reason for hiding this comment

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

전체적으로 코드 깔끔하게 잘 만드신거 같네요. 다른 종류의 무기도 한번 추가해보죠

private void Start()
{
player = GameObject.Find("Player").transform;
}

void Update()
{
Copy link

Choose a reason for hiding this comment

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

깔끔하게 잘 구현하셨네요

enemyObject.GetComponent<SpriteRenderer>().color = PickRandomColor();
GameObject enemy = Instantiate(enemyPrefab, PickRandomPosition(), Quaternion.identity);
enemy.transform.SetParent(transform); // ������ ���� �θ� ������Ʈ�� �߰�
enemy.GetComponent<SpriteRenderer>().color = PickRandomColor();
Copy link

Choose a reason for hiding this comment

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

적 생성후 부모 오브젝트에 추가하는거 좋네요


private Rigidbody2D rb;

[SerializeField] private float moveSpeed;
Copy link

Choose a reason for hiding this comment

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

다른 의도가 있었는지는 모르겠는데, [SerializeField]는 기본적으로 private속성을 가지고 있기 때문에 뒤에 private를 안 달아도 됩니다.

}

private void Move()
{
Copy link

Choose a reason for hiding this comment

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

Update의 xInput과 yInput 변수들을 Move함수 내에서 정의하는게 더 깔끔할거 같네요.


// Ÿ�� �������� �̵�
Vector3 direction = (target.position - transform.position).normalized;
transform.position += direction * speed * Time.deltaTime;
Copy link

Choose a reason for hiding this comment

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

타겟이 없으면 화살삭제, 타겟 방향으로 이동
위 코드들도 다 함수로 만들어서 Update에 넣으면 좀더 깔끔한 코드가 될거 같네요

}
}

return closestEnemy;
Copy link

Choose a reason for hiding this comment

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

함수구현 이쁘게 잘되었네요. 좋습니다

화살 무기 코드 수정
arrow system
무기 추가
@hwanginseop
Copy link

코멘트 확인 수정 하고 코멘트 달아주시면 merge하겠습니다~

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