I've got a water level with a buoy in it. When the player jumps on the buoy, I'd like it to smoothly sink down about 90 pixels and then stop so the player can jump on it one more time.
I have it set up like this:
Player on collision with Buoy: Buoy MOVETO position self.x, self.y+90
This works perfectly, except that I found when the player continues to move, the buoy's X position also moves, so the buoy follows the player while sinking rather than staying at its original X position.
This is probably because the main mechanic of my game involves dragging the level horizontally using DragDrop, so that technically the buoy's X position IS changing, unfortunately.
How do I set it so that the buoy object only moves up/down relative to the rest of the level, regardless of when I'm dragging the level?
Here is the project, where it should make more sense ("GameSheet" & "2-0" are where the behavior happens).
drive.google.com/file/d/1-MLn4d0Ki72nUBrdgL5fMlXW9Acp6Bzs/view