Results 1 to 5 of 5

Thread: how do u randomize option button = true 4 a game

  1. #1

    Thread Starter
    Lively Member Lord Rayv3n's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    65

    how do u randomize option button = true 4 a game

    im including a pic. each one of the buttons are OptionButton, and what i need is way to get a random button to become true when the current button that is true is clicked.
    oh and also need a way to count how many buttons the player has clicked.
    i would be greatfull for any help i could get.


  2. #2
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    Put them in an array, if you havn't already, then call a random one.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  3. #3

    Thread Starter
    Lively Member Lord Rayv3n's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    65
    ok i have already put them in an aray, but how do i call random buttons to become true??

  4. #4
    Member 110359's Avatar
    Join Date
    Jun 2002
    Location
    Melbourne, Australia
    Posts
    43
    Firstly why did you copy your whole post. You only needed the random bit.

    Secondly, this isn't an exact thing of what you should do but perhaps try something like:

    (assuming that your talking about enabling a button called button one and a label called count)
    r as integer
    r = 1 to 100
    If button1.enabled = true then
    button(r).enabled = true
    end if

    thirdly, the counter thing is like what I've already told you, something along the lines of
    button1_click()
    count.caption = count.caption + 1

    110359
    Why is it that when you kill one man people call you a murderer and when you kill one thousand you are a conqueror?

  5. #5
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    To get a random button, try this.

    VB Code:
    1. Randomize Timer 'This line only needs to appear once in your program (i suggest in form_load)
    2. button((Rnd*(Ubound(button)+1-Lbound(button))) * Lbound).Enabled = true
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width