Report as inappropriate.

Small_thumb

mjrb4 presents ...

2009/4/22

Card Demo

Click and drag the cards around, press the green button to create a new random card and hold the right mouse button down to filp the card over.

This may be of help to anyone wanting to implement card games in Greenfoot... Though remember to copy all the images (in resources/cards) over to your project (as well as the Card source code) if you want to use this in your own scenarios.

As an aside, this could also be used as a demo of enums (enumerations.) Have a look in the Card class to see why!

Updates:
- Got rid of the button and added a deck instead.
- You can create a normal deck, or specify the numbers of sets of different suits you want. You can also specify whether or not you want to include jokers.
- When the deck is empty, it just shows an outline.
- Press space to refill the deck and get rid of the cards.
- The card that you're dragging or have dragged last now appears on top of all the others.
- Added a couple more methods to Deck and Card that may come in useful.

3080 views / 13 in the last 7 days

3 votes | 0 in the last 7 days

Tags: mouse demo with-source

This scenario is a member of: Reusable actors & support classes, Cards


open in greenfoot
Your browser is ignoring the <APPLET> tag.
No_avatar_thumbastutik

2009/4/23

i like it
A new version of this scenario was uploaded on Thu Apr 23 12:46:04 UTC 2009
A new version of this scenario was uploaded on Thu Apr 23 19:33:18 UTC 2009

Want to leave a comment? You must first log in.

Who likes this?

No_avatar_thumb Photo_on_2011-09-18_at_18 Sb2_thumb