Yeah, I'll leave them remapped, but I can't very well test with your scenario because I don't have the java console configured so I can see it in my browser.
The way you detect repetition is flawed, I'll get a number sequence like so:
114 - 60 - 456 - 240 - 480 - 288 - 576 - 480 - 288 - 576 - 480 - 288... etc., repeating 288, 576, and 480, but the entire thing is red, as though it didn't repeat at all. I imagine it's looking for the next time it sees the value 114 followed by 60... and so on.
Figured it out! It's quite obvious really, when you think of why only negative accelerations have any impact... until the acceleration is larger than a whole number. Your x and y location variables are integers, so when you add 0.05 to integer 5, you still have 5, because when you get 5.05, it's truncated back to an integer, so it just takes 5 off of 5.05. When you subtract 0.05, you get 4.95, which when truncated yields 4. The simple solution to this is to make your x and y location variables doubles, and whenever you do setlocation, do it like so: setLocation((int)x, (int)y);
By the way, there's no shortage of gravity simulation scenarios on greenfoot, which was something I realized and influenced my decision not to post mine.
2014/1/1
Residents
2013/12/31
Residents
2013/12/30
UserInfo String Test
2013/12/30
UserInfo String Test
2013/12/30
Linear Congruential Generator (LCG)
2013/12/30
UserInfo String Test
2013/12/30
Gravity Sim
2013/12/30
Gravity Sim
2013/12/30
Gravity Sim