Fixed random number range in Orbit.java.

This commit is contained in:
Darren Cardenas
2021-04-01 21:11:24 -04:00
parent 530c8291fd
commit 01c701ee3a

View File

@@ -112,10 +112,9 @@ public class Orbit {
// Begin outer while loop // Begin outer while loop
while (true) { while (true) {
shipAngle = (int) (361 * Math.random());
shipAngle = (int) Math.floor(360 * Math.random()); shipAltitude = (int) (201 * Math.random() + 200);
shipAltitude = (int) Math.floor(200 * Math.random() + 200); shipRate = (int) (21 * Math.random() + 10);
shipRate = (int) Math.floor(20 * Math.random() + 10);
hour = 0; hour = 0;
@@ -157,7 +156,7 @@ public class Orbit {
// Win condition // Win condition
if (bombDistance <= 50) { if (bombDistance <= 50) {
System.out.println("YOU HAVE SUCCESFULLY COMPLETED YOUR MISSION."); System.out.println("YOU HAVE SUCCESSFULLY COMPLETED YOUR MISSION.");
break; break;
} }