작은 게임 인 2D를 만들고 있는데 플레이어가 있습니다.물체의 충돌 시스템?
는편집 :
이 내가 지금 무엇을 가지고 : 나는 한쪽에서 갈 때
int oldX = player.x;
int oldY = player.y;
int newX = oldX - player.getSpeedX();
int newY = oldY - player.getSpeedY();
if(player.getBounds().intersects(brush1.getBounds())){
player.x = newX;
player.y = newY;
}else{
player.x = oldX;
player.y = oldY;
}
을하지만, 정말 이상한 행동, 그것은 등, 속도를 변경
이것에 [서클 라인 충돌 검출 (http://stackoverflow.com/questions/1073336/circle-line-collision-detection) – schnaader
더 상관 응답의 중복 가능성 아마도? – Stan