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.
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);
A new version of this scenario was uploaded on Mon Dec 30 23:55:07 UTC 2013
Fixed a bug
Added collisions
Can add objects
A new version of this scenario was uploaded on Tue Dec 31 00:17:42 UTC 2013
Fixed bug
Collisions still a bit buggy
can now remove objects
A new version of this scenario was uploaded on Tue Dec 31 00:36:24 UTC 2013
Randomly generated example
Can now clear all objects using 'c'
A new version of this scenario was uploaded on Tue Dec 31 01:06:12 UTC 2013
Fixed Collision
A new version of this scenario was uploaded on Tue Dec 31 01:48:49 UTC 2013
bug fix
A new version of this scenario was uploaded on Tue Dec 31 10:39:12 UTC 2013
Can now zoom in and out
A new version of this scenario was uploaded on Tue Dec 31 13:42:14 UTC 2013
fixed a bug
A new version of this scenario was uploaded on Wed Jan 01 14:06:20 UTC 2014
fixed some bugs
added more collisions
-you can switch between collision types using 'z'
A new version of this scenario was uploaded on Wed Jan 01 19:30:29 UTC 2014
Now starts off with a solar system.
A new version of this scenario was uploaded on Tue Jan 28 19:11:40 UTC 2014
Fixed stick collision
Now starts off with a binary star system
A new version of this scenario was uploaded on Wed Jan 29 18:30:14 UTC 2014
simplified code
A new version of this scenario was uploaded on Thu Jan 30 18:42:56 UTC 2014
fixed a bug
A new version of this scenario was uploaded on Tue Feb 04 18:58:21 UTC 2014
you can now pause and add/remove objects with 'p'
A new version of this scenario was uploaded on Wed Feb 05 17:54:53 UTC 2014
Now has a starry background
A new version of this scenario was uploaded on Wed Feb 05 17:56:17 UTC 2014
Now has a starry background
Is there anything I can add so more people will like this?
A new version of this scenario was uploaded on 2016-07-31 17:28:44 UTC
Fixed bouncing collision types
Next update will include:
better motion
better UI
A new version of this scenario was uploaded on 2016-07-31 17:31:18 UTC
Updated tags
When "stick" is enabled objects appear to become one object, but really they act separately, however because of this if you have three objects stuck together, there will be a wired glitch where momentum is gained even though it should be conservered.
2013/12/30
2013/12/30
2013/12/30
2014/2/13
2014/2/20
2016/8/1
2016/8/1
2016/8/1
2021/5/6
2021/5/7
2021/5/7