PDA

Click to See Complete Forum and Search --> : Card Games Again


Cyber_Warrior
Oct 30th, 2000, 12:57 AM
I really hate to be a pain.

But I am now having another problem with my card game.

I now have it dealing the cards on startup and I can drag the actual card.

But now I have a major problem with the cards re-dealling. When re-dealt the cards are fine. But when I drag one card over another card, that cards current face is wiped off and the original one comes back.

EG. I start the program. I get the Ace and two of spades. Re-deal and these are now the King and Queen of hearts. Lets say I drag the King over the Queen. The Queen picture is removed and the two of spades comes back again.

There is probably an easy way of fixing this problem. But I can't find it. I am hoping someone might be able to shed some light on it.

Thanks

kedaman
Oct 30th, 2000, 06:54 AM
Probably, but it could be almost anything, where's your code for moving the cards? Do you have positions for all cards?

Cyber_Warrior
Oct 31st, 2000, 04:56 PM
Here is the code that I am using to move the cards.



Private Sub picCards_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single Index as Integer)

'Global Variables.
StartX = X
StartY = Y

End Sub

Private Sub picCards_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single Index as Integer)

If Button = 1 Then
picCards(Index).Move picCards(Index).Left + X - StartX, picCards(Index).Top + Y - StartY
End If

End Sub


I hope this helps in solving my problem.

kedaman
Oct 31st, 2000, 06:00 PM
But when I drag one card over another card, that cards current face is wiped off and the original one comes back.

I mean what has that to do with Current face being wiped off? Sounds like you don't have Autoredraw turned on for the pictureboxes. And what do you mean by the original one comes back? Are you redrawing the pictures, and if so, how? or moving the cards without user input, whereas it could cause a faulty movement

Cyber_Warrior
Oct 31st, 2000, 06:56 PM
Thank you so much for trying to help, it is greatlly appricated.

I have since worked out how to and fixed the problem.

Once again Thanks for trying. :)