1. Cards Again

Hey Guys,
Its me again. I'm having another problem. I can't figure out how to reomove
a card (Playing cards) when it is displayed in my window. I've got the
random selection thing working. I just can't figure this crap out
AAUuuggghhh! Any help would be apreciated. thanks

new topic     » topic index » view message » categorize

2. Re: Cards Again

On Thu, 02 Dec 1999, you wrote:
> Hey Guys,
> Its me again. I'm having another problem. I can't figure out how to reomove
> a card (Playing cards) when it is displayed in my window. I've got the
> random selection thing working. I just can't figure this crap out
> AAUuuggghhh! Any help would be apreciated. thanks

First of all, do you mean you want to remove the drawn card from the deck, so
it won't be drawn again? or want to remove a card from the screen?
(1)
-----------------------------------------------------
-- function draw returns a hand of <<count>> cards
-----------------------------------------------------
function draw(integer count)
object hand
hand = {} -- empty
for i = 1 to count do      -- however many cards were requested
    x = rand(length(deck)) -- pick a card at random from remaining deck
    hand = append(hand, deck[x]) -- add that card to your hand
    deck = deck[1..x-1] & deck[x+1..length(deck)] -- remove card from deck
    if length(deck) < 1 then exit -- not enuf cards
    end if
end for
return hand
end function
(2)
If you're asking how to erase cards from the screen, you can call
repaintWindow(MainWindow) to erase the screen to the background color.
If you only want  to remove _one_ card, you'll have to erase the screen and
then re-draw all cards except the removed one. You can put your card
drawing routine in the window's onPaint event, so the cards will be redrawn
automagically whenever the window is repainted, moved or resized
Nobody said this stuff wasn't confusing :)

Irv

new topic     » goto parent     » topic index » view message » categorize

3. Re: Cards Again

Hello David,
      A simple way to make disappear one card is to draw a mask over
      it. If you don't know what a mask is, it's an image with the
      card draw on it but all in the back ground color.
      That's all.

--
Best regards,
 Caballero Rojo                            mailto:pampeano at rocketmail.com


Thursday, December 02, 1999, 9:52:15 AM, you wrote:

DR> Hey Guys,
DR> Its me again. I'm having another problem. I can't figure out how to reomove
DR> a card (Playing cards) when it is displayed in my window. I've got the
DR> random selection thing working. I just can't figure this crap out
DR> AAUuuggghhh! Any help would be apreciated. thanks



__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one place.
Yahoo! Shopping: http://shopping.yahoo.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu