Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

공hannah부

CJ UNIT 7기 게임TF #9(급식실 게임 - 자잘한 수정) 본문

프로젝트/CJ UNIT 7기 게임TF

CJ UNIT 7기 게임TF #9(급식실 게임 - 자잘한 수정)

Hannah0226 2022. 11. 28. 22:03
오늘의 내용

- BGM길이가 너무 길어 게임이 길어지는 것 같아 BGM길이 줄이기로 했다

- 게임 클리어 기준 높이기

- 드래그를 짧게 하면 클릭과 드래그가 동시에 인식되는 오류가 있다 -> 드래그 인식 정도를 지정해줘야겠다

 

BGM

- BGM은 https://mp3cut.net/ko/ 이 싸이트를 사용해 잘라주었다.

- 길이를 얼마나 잘라야할 지 몰라 1분 9초, 1분 25초 짜리 두개를 만들어두고 게임에 넣어 뭐가 가장 적당할지 테스트 해보았다.

- 테스트해보니 1분9초는 너무 짧은 것 같아 1분 25초로 결정!

- 노래가 짧아졌으니 생성되는 학생 수도 줄여야 했기에 생성되는 학생 수를 97명에서 82명으로 바꿔주었다

//NoteManager
if(StudentNum <= 82)

 

Game Clear 기준 높이기

- 1000점은 너무 쉬운 것 같아 1500점으로 기준을 높였다

//Result
if(t_currentScore >= 1500)
	GameClear.SetActive(true);
else
	GameOver.SetActive(true);

 

드래그, 클릭 인식 문제

- startTouchPosition, endTouchPosition 변수를 만들어 드래그가 시작되면 시작된 x좌표를 startTouchPosition에 넣어주고 드래그가 끝나면 끝난 x좌표를 endTouchPosition에 넣어준다

- 드래그가 끝났을 때 startTouchPosition, endTouchPosition에 저장된 값을 비교해 endTouchPosition 값이startTouchPosition + 100을 한 값보다 크면 동작되도록 수정하였다.

//NoteO
public void OnBeginDrag(PointerEventData eventData)
{
	startTouchPosition = Mathf.RoundToInt(transform.localPosition.x);
}

public void OnDrag(PointerEventData eventData)
{

}
    
public void OnEndDrag(PointerEventData eventData)  //스와이프하면 miss뜨도록(식판든 학생이기 때문)
{
	endTouchPosition = Mathf.RoundToInt(transform.localPosition.x);
	if(endTouchPosition >= startTouchPosition + 100)
	{
		theEffect.JudgementEffect(4);
		theScoreManager.IncreaseScore(4);
		theComboManager.ResetCombo();
		Destroy(gameObject);
		theNoteManager.ChangeStudentOSad(endTouchPosition);
	}
}

 

추가할 것

- instantiate로 이미지를 계속 생성 / 삭제하면 모바일 환경에서 렉이 많이 걸린다고 한다 -> 학생들을 object pooling 해서 프로그램을 가볍게 만들어야겠다

- 게임이 끝난 후 다시시작할 수 있는 버튼을 추가해줘야겠다