Well, it's part of my time snippet. I don't need to call it - I could just manually inline the code.
Also, that bug I found where the border was being drawn onto the world doesn't seem to appear in 1.5.6.
I fixed an issue with Player falling through. I really don't understand comparable :(
Anyways, Davmac, can you describe how "reset" works in greenfoot? I get OddDuplicateAddExceptions, which should never happen.
Reset constructs a new world but it does not change static state (compile will). So that should explain those exceptions. There is also a bug in your code that the skip-list-set can be out of sync with the world; when you remove a disappearing platform from the world, it remains in your skip-list-set which can subsequently cause a NullPointerException. From a glance your comparable code looks right -- what problem are you having with it currently?
Edit: mistaken about reset, originally.
I know about the out-of-sync bug; just don't remove it. I'll obviously need to implement a remove method that removes the reference.
Where did I mention comparable?
EDIT: Just fixed collision to detect for the x dimension.
I swear, CTRL+F didn't find it!
About comparable: When I change the variable that determines the number the compareTo() method returns, does the navigable set account for that?
Bah!
Anyways, a note to myself.
1. Collision is still not working too well. The above may be the reason, but I'm not sure why; the result of the compareTo() method is supposed to be consistent in my program. Sometimes, the player will randomly fall through the platforms. These bugs always seem to disappear after a while. I also am programming this at school on 1.5.6, and at home on 2.0.1, so that may be an issue. Sometimes the player falls through a platform if he moves through at a low angle.
2. I need to make x movement act-independent, and look better.
3. I need to make comparable work for platforms at the same y level.
3. For some reason, moving up through a platform sometimes causes the player to zoom up.
As usual, all my bugs disappear when I get home to 2.0.1
#1, and the second #3 are fixed with a pure greenfoot version adjustment, seemingly. I can no longer reproduce the bug. #3 was trivially easy to reproduce on 1.5.6 and now impossible to reproduce on 2.0.1.
That's deliberate. The documentation (installation instructions) says you need the Oracle JDK. There were problems with OpenJDK in the past, so Greenfoot requires the Oracle JDK (the package is called "sun-java6-jdk").
Having said that, the next Greenfoot release will allow OpenJDK as an alternative.
Scenarios exhibits unwanted behavior under Oracle JDK 1.6.07. Does not exhibit under 1.6.22. Greenfoot versions both 2.0.2.
Test case to be uploaded by this afternoon.
Keyboard motion obviously is broken on the web version. (Movement went wild.) It is bug free when I self-compile.
Sorry if I'm stating the obvious, but the movement on your uploaded scenario seems fine if I reduce the speed slider a bit. If the speed is at maximum then pressing left/right causes the square crate thing to move way too fast.