Closed juliakispert closed 4 years ago
There were two problems here:
GraphicsGroup
didn’t update its center properly. I just fixed that; pull 127-shared to get the fix.pixel
group has all positioned all its individual components so that they are in the bottom middle of the screen even when the group itself is positioned at the upper left. This is the source of your platform bounce detection problems. To solve it, change these lines of code so that you do not use CANVAS_WIDTH
or CANVAS_HEIGHT
, but instead position all the group elements so that pixel’s upper left corner is at (0,0) in local group coordinates. Then move the whole group around the screen.
When calling getX() or getCenter() position of graphic group does not seem to be correct. Issue also is seen when calling setCenter() on a graphic group. This line: https://github.com/mac-comp127-f19/PixelJump/blob/master/src/PixelJump/Pixel.java#L77, moves the group off the screen.