mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
fixed bug
#story[1250]
This commit is contained in:
@@ -396,11 +396,14 @@ public class GameState implements Runnable {
|
|||||||
public static void checkCollision(ServerYacht serverYacht) {
|
public static void checkCollision(ServerYacht serverYacht) {
|
||||||
//Yacht Collision
|
//Yacht Collision
|
||||||
ServerYacht collidedYacht = checkYachtCollision(serverYacht);
|
ServerYacht collidedYacht = checkYachtCollision(serverYacht);
|
||||||
|
Mark collidedMark = checkMarkCollision(serverYacht);
|
||||||
|
|
||||||
if (collidedYacht != null) {
|
if (collidedYacht != null) {
|
||||||
GeoPoint originalLocation = serverYacht.getLocation();
|
GeoPoint originalLocation = serverYacht.getLocation();
|
||||||
serverYacht.setLocation(
|
serverYacht.setLocation(
|
||||||
calculateBounceBack(serverYacht, originalLocation, BOUNCE_DISTANCE_YACHT)
|
calculateBounceBack(serverYacht, originalLocation, BOUNCE_DISTANCE_YACHT)
|
||||||
);
|
);
|
||||||
|
System.out.println("DID BOUNCE BACK");
|
||||||
serverYacht.setCurrentVelocity(
|
serverYacht.setCurrentVelocity(
|
||||||
serverYacht.getCurrentVelocity() * COLLISION_VELOCITY_PENALTY
|
serverYacht.getCurrentVelocity() * COLLISION_VELOCITY_PENALTY
|
||||||
);
|
);
|
||||||
@@ -416,11 +419,12 @@ public class GameState implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Mark Collision
|
//Mark Collision
|
||||||
Mark collidedMark = checkMarkCollision(serverYacht);
|
else if (collidedMark != null) {
|
||||||
if (collidedMark != null) {
|
|
||||||
serverYacht.setLocation(
|
serverYacht.setLocation(
|
||||||
calculateBounceBack(serverYacht, collidedMark, BOUNCE_DISTANCE_MARK)
|
calculateBounceBack(serverYacht, collidedMark, BOUNCE_DISTANCE_MARK)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
System.out.println("DID BOUNCE BACK2");
|
||||||
serverYacht.setCurrentVelocity(
|
serverYacht.setCurrentVelocity(
|
||||||
serverYacht.getCurrentVelocity() * COLLISION_VELOCITY_PENALTY
|
serverYacht.getCurrentVelocity() * COLLISION_VELOCITY_PENALTY
|
||||||
);
|
);
|
||||||
@@ -430,11 +434,13 @@ public class GameState implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Boundary Collision
|
//Boundary Collision
|
||||||
if (checkBoundaryCollision(serverYacht)) {
|
else if (checkBoundaryCollision(serverYacht)) {
|
||||||
serverYacht.setLocation(
|
serverYacht.setLocation(
|
||||||
calculateBounceBack(serverYacht, serverYacht.getLocation(),
|
calculateBounceBack(serverYacht, serverYacht.getLocation(),
|
||||||
BOUNCE_DISTANCE_YACHT)
|
BOUNCE_DISTANCE_YACHT)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
System.out.println("DID BOUNCE BACK3");
|
||||||
serverYacht.setCurrentVelocity(
|
serverYacht.setCurrentVelocity(
|
||||||
serverYacht.getCurrentVelocity() * COLLISION_VELOCITY_PENALTY
|
serverYacht.getCurrentVelocity() * COLLISION_VELOCITY_PENALTY
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user