강의

멘토링

커뮤니티

Inflearn Community Q&A

idim76323's profile image
idim76323

asked

[Unity 6] Learning by Doing: Dr. Go's 2D Platformer Game Development

02-02 Player Health

02-02 플레이어 체력에서 if(current >1)을 if(current > 0) 로...

Resolved

Written on

·

87

·

Edited

0

해야 될 것 같아요.

그래야 체력이 0으로 떨어질 수 있고,

지금 상태에서는 current가 1일 때 사망처리가 되어 버리는 문제..

C#unity

Answer 1

1

unitynote님의 프로필 이미지
unitynote
Instructor

if ( current > 1 )이 맞습니다.

 

하트가 3개 있으니 3대 맞으면 죽어야 하고,

current가 3일 때 맞으면 current는 2가 됩니다. (1대)

current가 2일 때 맞으면 current는 1이 됩니다. (2대)

current가 1일 때 맞으면 죽습니다. (3대)

idim7님의 프로필 이미지
idim7
Questioner

다시 생각해보니.. 강사님 말씀이 맞네요.^^


idim76323's profile image
idim76323

asked

Ask a question