Commit e1d9b0db authored by Nicholas Bindela's avatar Nicholas Bindela
Browse files

End of day Thursday

parent a3cb0bf3
......@@ -55,8 +55,8 @@ public class Level1 extends Level {
private static int char_Width = 100;
private static int char_Height = 100;
private static float backgroundX2 = (float) WIDTH;
private static float backgroundX = (float) 0.0;
private static float backgroundX2;
private static float backgroundX;
private static float dX = (float) 1;
private String meters = "M";
......@@ -94,6 +94,9 @@ public class Level1 extends Level {
container.setSmoothDeltas(true);
pointCounter = 0;
backgroundX2 = (float) WIDTH;
backgroundX = (float) 0.0;
Image city = new Image("Images/city.png");
city = city.getScaledCopy(WIDTH + 55, HEIGHT);
background = city;
......@@ -135,7 +138,7 @@ public class Level1 extends Level {
character.update(container, delta);
if (!((int) (pointCounter / levelLength) == spawnInterval)) {
if (!((int) ((pointCounter / levelLength) + 0.5) == 1)) {
if (pointCounter % spawnInterval == 0) {
obstacles.add(new Obstacle(1));
}
......
......@@ -128,7 +128,7 @@ public class Level2 extends Level {
}
character.update(container, delta);
if (!((int) (pointCounter / levelLength) == spawnInterval)) {
if (!((int) ((pointCounter / levelLength) + 0.5) == 2)) {
if (pointCounter % spawnInterval == 0) {
obstacles.add(new Obstacle(1));
}
......
......@@ -129,7 +129,7 @@ public class Level3 extends Level {
}
character.update(container, delta);
if (!((int) (pointCounter / levelLength) == spawnInterval)) {
if (!((int) ((pointCounter / levelLength) + 0.5) == 3)) {
if (pointCounter % spawnInterval == 0) {
obstacles.add(new Obstacle(1.5f));
}
......
......@@ -127,7 +127,7 @@ public class Level4 extends Level {
}
character.update(container, delta);
if (!((int) (pointCounter / levelLength) == spawnInterval)) {
if (!((int) ((pointCounter / levelLength) + 0.5) == 4)) {
if (pointCounter % spawnInterval == 0) {
obstacles.add(new Obstacle(1.5f));
}
......
......@@ -126,7 +126,7 @@ public class Level5 extends Level {
}
character.update(container, delta);
if (!((int) (pointCounter / levelLength) == spawnInterval)) {
if (!((int) ((pointCounter / levelLength) + 0.5) == 5)) {
if (pointCounter % spawnInterval == 0) {
obstacles.add(new Obstacle(2));
}
......
......@@ -127,7 +127,7 @@ public class Level6 extends Level {
}
character.update(container, delta);
if (!((int) (pointCounter / levelLength) == spawnInterval)) {
if (!((int) ((pointCounter / levelLength) + 0.5) == 6)) {
if (pointCounter % spawnInterval == 0) {
obstacles.add(new Obstacle(2));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment