-
hi,
i used this code
Private Sub Command1_Click()
Dim Num1%, Num2%
Randomize Timer
Num1 = Int((6 * Rnd) + 1)
Num2 = Int((6 * Rnd) + 1)
Image2.Picture = LoadPicture("C:\My Documents\vb\Total Domination\dice\dice " & Num1 & ".jpg")
Image3.Picture = LoadPicture("C:\My Documents\vb\Total Domination\dice\dice " & Num2 & ".jpg")
End Sub
to create the random dice
but now i need something that adds up the dice and displays the answer in a label, i am leading this to once the label has the number it has to move an object to set of co-ordinated, that coincide with the number on the dice
PLEASE HELP ME !!!
Thanks
Merlin ?
-
I'm not sure what you meant, something like this?
Code:
label1=num1+num2
object.move num1,num2
-
thanks
hi,
the label bit worked
but the object move thing didn't but that doesn't matter as
i want to move the piece to specific co-ordinates
any suggestions
(p.s. this might help you, i am designing a board game,
hence all of the dice and moving questions)
Cheers
Merlin ?
-
Well what object are you moving? What coordinates are you using?
-
hi,
i'm using an image to move
and the co-ordinates are those on the page
so if the dice came up 6 then i would find where the sixth
place is and write the co-ordinates are
x1,x2,y1,y2
can you help ?
Merlin ?
-
What about the other coordinates? Do you have them systematically aranged by an algoritm, using an array, or just want to have a select case to do that? I would recommend an algoritm, but you should tell how your board game looks like
-
the board is a square and you go aaround the outside of it,
do you think that i could use the move commnad ?
if so do you have any suggestions ?
Merlin ?
-
Of course you have to use move command, if youi woudnt prefer to change left and top property separately. Now you still makes it hard for me get anything understood the problem when you're not explaining enough. I have to give you an example instead and see if you like it.
Code:
image1.move 64+num1*32,64+num2*32
Put this after your code, change image1 to you imagebox name, run it and tell me if it's that you wanted
-
it sort of works
would it help if i emailed you my project so far ?
Merlin ?
-
If everything works fine, then you don't need to, but if you want me to have a look at it, it's ok. I could give you some good advice on what to do next :)