-
Notifications
You must be signed in to change notification settings - Fork 2
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
Week2 #17
base: main
Are you sure you want to change the base?
Week2 #17
Conversation
방향키와 WASD로 움직이는 스크립트 작성
배경화면 설정 및 Circle에 Sprite 적용
Player를 따라오는 Enemy를 1초 마다 생성하는 Spawner 구현
Player의 이동과 애니메이션 구현
Tilemap 배치와 Player의 이동에 따른 Tilemap 재배치 구현
생성된 enemy가 player를 추적하지 않는 문제 해결
무기1(총과 총알) 기능 구현
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
전체적으로 코드가 깔끔하고 이해하기 쉽게 적어놓으셔서 좋았습니다.
아직 안 배운 Object Pooling을 사용하신거도 좋았습니다.
2주차 과제도 고생하셨습니다
if(exp == nextExp[level]) | ||
{ | ||
exp = 0; | ||
level++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
레벨업 할때마다 경험치 통 늘리는거 좋네요
ran[0] = Random.Range(0, items.Length); | ||
ran[1] = Random.Range(0, items.Length); | ||
ran[2] = Random.Range(0, items.Length); | ||
if (ran[0] != ran[1] && ran[0] != ran[2] && ran[1] != ran[2]) break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지금 랜덤으로 뽑는 과정에서 겹치는 아이템이 없을 때까지 while문이 돌아가는데,
items배열을 랜덤으로 섞은후 앞에서 3개를 가져오는등과 같은 방법으로 해봐도 좋을거 같네요
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class PoolManager : MonoBehaviour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 Object Pooling을 사용하신거 같네요. 좋습니다.
if (diffX > diffY) | ||
{ | ||
transform.Translate(Vector3.right * dirX * 40); | ||
} else if(dirX < diffY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
플레이어의 위치에 따른 배경의 재배치 코드인거 같네요. 좋습니다.
다만 여기서 dirX가 오타인건가요? diffX가 맞는 변수 같네요
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class Scanner : MonoBehaviour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
가장 가까이 존재하는 Transform을 찾아주는 코드네요.
적을 공격할때 유용하게 쓰이겠네요. 좋습니다
코멘트 확인 수정 하고 코멘트 달아주시면 merge하겠습니다~ |
변경점 👍
무기1(총이랑 총알) 구현
player 이동에 따라 맵과 카메라 이동하게 구현