breber / cardgames

Repository for continuation of CS309 Project
https://play.google.com/store/apps/details?id=com.worthwhilegames.cardgames
3 stars 1 forks source link

Grey out cards that can't be played #9

Closed breber closed 12 years ago

breber commented 12 years ago

When telling people what our project was, I have had many people tell me that they don't know how to play crazy eights, and if we continue to add other games, I can see the number of people not knowing how to play a certain game increase. Another point of confusion could be the "house rules." For instance, until about halfway through the project, I didn't realize that you could play an 8 on anything, even if the 8 doesn't match suit.

So based on this, I wonder if we want to add a preference that would allow us to grey out cards that are not able to be played, therefore helping the user learn to play the game.

I don't think this would be hard to implement (we could just iterate through all cards in a user's hand when it is their turn, and then check the canPlay method or whatever it is called, and the grey it out if it isn't allowed).

What are your thoughts?

j7peters commented 12 years ago

I think that is a great idea. I also think that it would be easy except for the part about greying out the cards. Does anyone know how to do that? Checking which cards are playable would be easy.

another question. If the card is grey should we allow the player to even select it? and right now the player's selection persists so if they select something, then draw, then when it is their turn again it will still be selected? etc. Also when it is not their turn should we grey all cards? or not grey all cards?

breber commented 12 years ago

As far as actually greying out cards, we can use ImageView.setColorFilter(0x77888888); (where 0x77888888 is a shade of grey)

j7peters commented 12 years ago

I just pushed upstream some code that I think will work? please try it sometime. I have not tested.

breber commented 12 years ago

I made a couple changes, and I think it is working.

Now do we want to add a preference to enable/disable this feature?