Hi, for the following Slick2D code I have two questions.
(zoom is a float and zoom2 is a double)
public void mouseWheelMoved(int change) {
if (change >= 120) {
Info.zoom += .1;
Info.zoom2 += .1;
} else {
Info.zoom -= .1;
Info.zoom2 -= .1;
}
System.out.println(Info.zoom + " " + Info.zoom2);
}
- I’ve seen this happen before when I used Java2D but why is “int change” measured by 120s?
- In the Console my numbers eventually look like .7999995 instead of .8 or .2000000000000015 instead of 2, why does this happen, is there a way to fix this?
Thanks for any help you guys can provide.