aoberoi / SwiftUI-Set

CS193P Set game using SwiftUI (Spring 2023)
0 stars 0 forks source link

Change New Game intent to first collect all cards in the deck and then shuffle the deck. #6

Closed aoberoi closed 7 months ago

aoberoi commented 1 year ago

This is an experimental idea related to the New Game animation issues (#1 #4 #5). One theory is that the animations issues are related to the idea that there's a different stacking order (zIndex) for the same cards in the playArea, deck, and discardPile - so the animation system cannot compute a consistent way to draw the views for the insertion and removal animations.

I think we could insert all the playArea cards back to be the topmost cards on the deck, and insert all the discardPile cards back to the the bottom cards in the deck. They would all have to flip over at the same time. These changes would be in one withAnimation block. Then in another withAnimation block, with a delayed animation (or maybe no animation at all), the deck would be shuffled. Finally in another withAnimation block with a delayed animation the new game would be dealt.

aoberoi commented 7 months ago

I'm not sure the animations will be structured anything like this, once I'm through with refactoring things to be more modern.