I am making a small card game, which will require cards to appear at random times.
Here is my code:
VB Code:
Private Sub cmdRoll_Click()
Randomize
Dim x
For x = 0 To 5
a% = Int(Rnd * 5) + 1
Call pict
Next
End Sub
Public Sub pict()
Dim i
For i = 0 To 5
If a% = 1 Then
???
End Sub
I have 5 images called "card" with indexes of (0) to (4)
On the line "If a% = 1 Then" i am trying to mmake it so if the random value "a%" is 1, then a 10 will appear, if "a%" is 4 then an Ace will appear etc.
however, i cant find a way of getting the cards to show. I would need some kind of image database to store all of the images inside the project but how would i do that?
That makes no relevance or sense to my project. Thanks anyway.
I asked whether there was a way of getting an image database in VB, so i could write (after a button gets pressed for example) "card(0).picture=ace.bmp" or something along those lines
ok this attachment should explain how to do it. It shows how to load images into the image array and how to call them back and display them. If any questions just ask.
It is a vb6 source code and some images
O just noticed when you exit you get an error
VB Code:
Unload form1
Set frmMemoryDC = Nothing
'shold be only
unload me
sorry
Last edited by damasterjo; Nov 27th, 2005 at 12:59 PM.
As I have asked again and again, is there a way of getting the images To be implemented into my project, so, instead of having to go through all the trouble of externally loading images, just being able to have the images ready at runtime