Simple-Solitaire icon indicating copy to clipboard operation
Simple-Solitaire copied to clipboard

[Question] How can a game remove a card?

Open dseomn opened this issue 7 years ago • 3 comments

I'm trying to implement Maze, which deals all 52 cards then removes the kings from play entirely. I tried calling Card.removeFromCurrentStack() on the kings, but that didn't seem to update the display of the game, and the game crashes when I try to move one of the kings that shouldn't even be there. It looks like none of the SharedData.moveToStack methods are meant to be called with a null destination stack. Is there some other way to remove a card from a stack without moving it to another stack?

dseomn avatar Jun 26 '18 02:06 dseomn

well this is not implemented, I can add it after my next release. But you could use the same approach as I did in Mod3: Just create a new separated stack to put the cards on. Then you could set its X and Y positions both to eg. -5000, so the stack wouldn't be visible anymore. But when I add this as a function, I would add a nice little fading effect for that.

If you want to, I also could implement the game, it shouldn't be difficult. Then you don't need to try understand my code :)

TobiasBielefeld avatar Jul 01 '18 17:07 TobiasBielefeld

Thanks for the idea, an off-screen discard stack seems to work. I think I'm already more than half done implementing the game, so I might as well finish it. I think all I have left to do is figure out what hints to give and how to score the games, edit pictures/menu/backgrounds_menu_default.xcf and app/src/main/res/drawable-nodpi/backgrounds_menu.png, and test the game. Then I'll send you a pull request.

dseomn avatar Jul 02 '18 19:07 dseomn

oh nice work :) But I can at least make the menu icon, because I have a kinda special way to make them and I didn't thought about a real instruction to that yet

TobiasBielefeld avatar Jul 04 '18 18:07 TobiasBielefeld