Results 1 to 8 of 8

Thread: VB6 Quiz Game help

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2010
    Posts
    3

    VB6 Quiz Game help

    Hi, I'm relatively new to VB6 and would like some help if possible please. I need to create a quiz game using VB6 where a player answers 6 randomly generated questions and gets points for every correct answer given.

    Now, I have been able to create the game but the final stage I am having trouble with is creating a 'leaderboard' where the top 10 scores are displayed. I have a 'Submit Score' command button on my main game form, which takes the player through to a 'Scores' form. This also takes over the player name, level and score using global variables. My college lecturer has advised that I need to add the scores to a database, and then the top 10scores are displayed on the form.

    My questions are this:

    1) How do I get the player scores into the database?
    2) How do I then get the top 10 scores displayed on the form? Should I use SQL?

    All help is appreciated!

  2. #2
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: VB6 Quiz Game help

    If your lecturer's advice is just that, and not a requirement, there are better ways to do such a simple task. Search the forum for "hiscores" and other key words and you should be able to find some examples.

    Personally I'd just save the top 10 scores into a text file and use that, although unless you encrypt the data it'd be easy to cheat and add your own scores.
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  3. #3
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: VB6 Quiz Game help

    For storing the scores in database, you can use MS Access as backend...
    For tutorials: http://www.vbforums.com/showthread.php?t=337051#ado

    And for displaying the scores, you could just use an SQL SELECT statement and ORDER BY clause (either ASC or DES)....

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  4. #4
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: VB6 Quiz Game help

    Dev

    Another alternative -- dirt cheap (and assumes you don't
    have access to (ahem) Access) -- just store the top 10
    scores in a text file.

    You'll need some code to read from/write to the text file,
    but it is fairly basic. Holler if you want to go down this road.

    Spoo

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2010
    Posts
    3

    Re: VB6 Quiz Game help

    Hi all, thanks to everyone that has replied.

    Spoo - I do have Access, but if you think the text file option is easier, then I'm open to your suggestions!

    Would it be easy to update after each score submission and then sort the top 10 scores?

    Cheers

  6. #6
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: VB6 Quiz Game help

    Dev

    It depends on what "easier" means...

    Since you have Access, that would probably be easier.

    However, if you plan to distribute your game to some users who
    don't have it, then the text file option would seem appropriate.

    How would you like to proceed?

    Spoo

  7. #7
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: VB6 Quiz Game help

    I was the first person to respond to this, and I mentioned text file as a method...I *also* mentioned searching the forum for ALREADY ANSWERED posts about this question, of which there are many.
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  8. #8
    PowerPoster Code Doc's Avatar
    Join Date
    Mar 2007
    Location
    Omaha, Nebraska
    Posts
    2,354

    Re: VB6 Quiz Game help

    Quote Originally Posted by Spoo View Post
    Dev

    Another alternative -- dirt cheap (and assumes you don't
    have access to (ahem) Access) -- just store the top 10
    scores in a text file.

    You'll need some code to read from/write to the text file,
    but it is fairly basic. Holler if you want to go down this road.

    Spoo
    Spoo, I think he could aslo store the top ten stores in a random access file, each record holding a user identifier and a score. Prior to writing to the file, he can check all existing scores and if the user doesn't crack the top ten, notify and trash the result. If he does, store it.

    Note that ties will have to be handled. Eventually, the top ten could have all reached the total points possible.
    Doctor Ed

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