Closed elmodor closed 1 year ago
This does also happen on normal cards when they hit the tables edge or are thrown around.
I guess the problem is that Stack.gd _physics_process
calls request_shuffle()
- so basically whenever there's a physics process the cards are shuffled. is_being_shaked
checks the velocity if it is "shaken". So maybe this velocity threshold is wrong?
This is the velocity when the card stack hits the edge and bounces back: 48369.363281
Force when a stack is clipping through the table and bumped up: 3599.904541
I think the velocity can't be used to indicate if it is being shaken. At least not the current and last velocity.
It basically checks to see if the acceleration switches direction by a given amount - having said that, wouldn't this be solved by having it also check to see if the stack is hovering? Since we only want this to happen if the stack is hovering anyway.
I tested it, and yes it fixes this issue. But it still gets shuffled on other occasions where it shouldn't. With the hovering fix the stack does not get shuffled when clipping/on table edge. But it still gets shuffled:
The first one I can see to be happening a lot more unintentionally - you drop a card stack but decide to pick it up again.
Having another condition checking if the piece changed orientation quickly in the last x seconds while being hovered and having the acceleration change?
Hmm... maybe it might be simpler to just disable shuffling for the first 0.5-1 seconds that a stack is hovered? I think that would cover both cases you mentioned.
Describe the bug When dropping a card stack which consists of larger cards, the cards are shuffled. This might be related to an issue that these cards are clipping through the table.
To Reproduce Steps to reproduce the behavior:
Expected behavior Cards are not shuffled
Screenshots shuffle.webm
Environment Arch Linux
Version v0.1.0 Beta 1