I am making an android game that needs to check a float x value, if the value is 320 it should be reset to 1, and if it is not, it should be increased by 15. This is the code that I am using, but however, it is not working:
if (x == 320) {
x = 1;
Parachuter p = new Parachuter(x, y);
parachuters.add(p);
Toast.makeText(getContext(), "x=" + x + " y=" + y, 15).show();
}
else {
x = x + 15;
Parachuter p = new Parachuter(x, y);
parachuters.add(p);
Toast.makeText(getContext(), "x=" + x + " y=" + y, 15).show();
}