我正在製作一款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 2011-04-23 12:25:33
更多關於這個答案可能重複,也許? – Stan 2011-04-25 00:10:02