mattt183 Posted March 12, 2011 Author Share Posted March 12, 2011 How do you make set boxes randomly come up when you hit a button? (making a question game)EXAMPLE:Question1Question2Question3I press a button and Question2 pops up, Next Time I click Question1 comes up,next time Question 3 comes up (need to make it so the same question doesn't come up twice), also need to make it boxes with text, not just text because i need answers. Link to comment Share on other sites More sharing options...
RyokuHasu Posted March 12, 2011 Share Posted March 12, 2011 You would have to write a complete mini-game script….I have some ideas, but no idea where you would start... Link to comment Share on other sites More sharing options...
iSKweek Posted March 12, 2011 Share Posted March 12, 2011 @RyokuHasu:> You would have to write a complete mini-game script….No. Just no.There are numerous simple ways you could do this. You could have a control array with different frames (each containing a question and 3 answer buttons) and then have a random number picked when the answer is correct to show the next question.ORYou could create all different frames with the questions (the same as above) but have a sub that shows the next question that calls a random number and then selects a frame from a select case thingy to show the question.Nothing too complex is needed. Link to comment Share on other sites More sharing options...
mattt183 Posted March 13, 2011 Author Share Posted March 13, 2011 ok, thanks for the ideas! Link to comment Share on other sites More sharing options...
iSKweek Posted March 13, 2011 Share Posted March 13, 2011 No problem, if you need any further help just ask :) Link to comment Share on other sites More sharing options...
evilbunnie Posted March 13, 2011 Share Posted March 13, 2011 ```Function ReturnRandomQuestion() as string Select Case Rand(1, 3) Case 1 ReturnRandomQuestion = "Hey do you like mudkipz?" Case 2 ReturnRandomQuestion = "Oh sup bro, how are you?" Case Else ReturnRandomQuestion = "Yeah, i'm cool, aren't i?" End SelectEnd Function``` Link to comment Share on other sites More sharing options...
mattt183 Posted March 13, 2011 Author Share Posted March 13, 2011 yes, but as I said I need boxes, not just text. Link to comment Share on other sites More sharing options...
iSKweek Posted March 13, 2011 Share Posted March 13, 2011 You would use the same format. So instead of storing text and having it as a function, you would have a sub that showed a picturebox or a frame. Eg:```Public Sub RandomQuestion as string Select Case Rand(1, 3) Case 1 fraQuestion1.Visible = True Case 2 fraQuestion2.Visible = True Case Else fraQuestion3.Visible = True End SelectEnd Sub``` Link to comment Share on other sites More sharing options...
mattt183 Posted March 13, 2011 Author Share Posted March 13, 2011 ahhhhhh, kk, very very new to VB6, thanks Link to comment Share on other sites More sharing options...
goku1993 Posted March 13, 2011 Share Posted March 13, 2011 But random would show the question twice so you also have to add a check somewhere shouldn't you? but well it shouldn't be that hard just store if the pic was opened or not somewhere and make it so if it already appeared won't.If i m wrong about what i just said and you have already found the solution for that sorry just saying what i though i read Link to comment Share on other sites More sharing options...
iSKweek Posted March 13, 2011 Share Posted March 13, 2011 That is true, could store all the numbers that are picked randomly in an array or something I guess and check through it before showing the question. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now