Close

Results 1 to 6 of 6
  1. #1
    DF VIP Member Tonysoprano's Avatar
    Join Date
    Jul 2002
    Location
    Wales
    Posts
    164
    Thanks
    0
    Thanked:        0
    Karma Level
    270

    Default Help required with Image/Multiple Choice game (vb)

    Heya all,

    At the moment, i'm in the process of making a game which will contain an image, then block images over that which disappear over time and the user has to guess the correct answer before all the pieces are gone.

    At the moment I have the image and ontop of that i've placed the block image in a control array. I have 3 blocks across and 3 down.

    Now the idea is to remove the pieces randomly, but also make sure that the same pieces aren't removed.

    So far i know i'm going to need .visible and use random numbers, however i'm not too fully sure how the random numbers will work in this instance.

    If anyone is able to offer and help/assistance/ideas then i'd appreciate it.
    Thank you,
    Ste
    [live=mister%20ste]misterste[/live]

  2. #2
    DF VIP Member /dev/null's Avatar
    Join Date
    Feb 2004
    Location
    Behind You
    Posts
    2,952
    Thanks
    0
    Thanked:        0
    Karma Level
    450

    Default Re: Help required with Image/Multiple Choice game (vb)

    Assuming your array indexes from 0 to 8 (3x3 squares=9 in total)...
    Just have a timer that fires at whatever interval you choose and when it does, selects a random number between 0 and 9. Keep boolean array of size 9 and whenever you uncover a square you set the corresponding boolean value to true. Then when you pick a number in the timer, loop through and pick one where the corresponding boolean value is NOT TRUE. Also, be sure to check in this loop the number you have uncovered else it could infinite loop if all are uncovered without the user guessing.

    I can't remember VB really (ages ago since I used) but something along the lines of:

    Code:
    'global variables
    dim num as integer
    dim uncovered(0 to 8) as integer
    
    'timer code
    dim index as integer
    index=int(9*rnd())
    randomize
    
    do while uncovered(index)<>true and num<9
    index=int(rnd()*9)
    loop
    
    pics(index).visible=false
    num=num+1
    If you are stil struggling I'll throw it together in VB and upload a demo for you.

    John

  3. #3
    DF VIP Member Tonysoprano's Avatar
    Join Date
    Jul 2002
    Location
    Wales
    Posts
    164
    Thanks
    0
    Thanked:        0
    Karma Level
    270

    Default Re: Help required with Image/Multiple Choice game (vb)

    Hey John,

    Thanks for the speedy reply, really appreciate it, not long after I posted the reply i manage to get a little further but not get it fully working. I'll pm you and perhaps we could talk about it some more?

    Some karma headed your way as well,
    Thanks again, really do mean that,
    Ste

    P.S
    Also, i apologise for posting this in the wrong forum, it was late when i originally posted the message, so if i mod could move it, that'd be great! Sorry again.
    Last edited by Tonysoprano; 28th April 2006 at 12:04 PM.
    [live=mister%20ste]misterste[/live]

  4. #4
    DF VIP Member /dev/null's Avatar
    Join Date
    Feb 2004
    Location
    Behind You
    Posts
    2,952
    Thanks
    0
    Thanked:        0
    Karma Level
    450

    Default Re: Help required with Image/Multiple Choice game (vb)

    Hi,
    I have attached a demo project for you to lok at in VB.
    Done on the condition that you WON'T JUST HAND IN THIS VERSION. Use it for reference only to help you!

    John
    Last edited by /dev/null; 9th November 2006 at 01:34 PM.

  5. #5
    DF VIP Member Tonysoprano's Avatar
    Join Date
    Jul 2002
    Location
    Wales
    Posts
    164
    Thanks
    0
    Thanked:        0
    Karma Level
    270

    Default Re: Help required with Image/Multiple Choice game (vb)

    Cheers John,

    I won't hand that version in, but thanks again, that helps alot, and it's well commented so thank you, it's a big help!

    Ste
    [live=mister%20ste]misterste[/live]

  6. #6
    DF VIP Member /dev/null's Avatar
    Join Date
    Feb 2004
    Location
    Behind You
    Posts
    2,952
    Thanks
    0
    Thanked:        0
    Karma Level
    450

    Default Re: Help required with Image/Multiple Choice game (vb)

    No props - Anything else you need just lemme know!

Similar Threads

  1. Whats your favourite Spectrum game of all time?
    By BFG in forum Old Skool Gaming & Retro
    Replies: 92
    Last Post: 20th September 2006, 09:43 AM
  2. Which multiple banee has pissed you off most?
    By ABCMan in forum Hall Of Shame
    Replies: 33
    Last Post: 23rd January 2003, 03:41 AM
  3. Game Reviews Forum
    By tagy in forum Forum Suggestions & Feedback
    Replies: 5
    Last Post: 10th December 2002, 05:12 PM
  4. Best PS2 Game
    By mark1984 in forum Sony Consoles
    Replies: 78
    Last Post: 1st November 2002, 03:11 PM
  5. Best Footie Game
    By vieri32 in forum Sony Consoles
    Replies: 28
    Last Post: 22nd September 2002, 04:27 PM

Social Networking Bookmarks

Posting Permissions

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