Results 1 to 6 of 6

Thread: Maths Game Timer

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Location
    Australia
    Posts
    4

    Question Maths Game Timer

    I'm making a maths game and i want to put in a timer so they have to answer the question within 10secs and if they run out of time the next question pops up.

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Okay so just add a timer with interval = 10000
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284
    .. or use the timer() function ->

    VB Code:
    1. Dim RegTimer As Single
    2.  
    3. RegTimer = Timer
    4.  
    5. Do While Timer - RegTimer < 2
    6.  'Wait 2 Sec.
    7. Loop
    8.  
    9. MsgBox "You are too late.. :)"

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by Jim Davis
    .. or use the timer() function ->

    VB Code:
    1. Dim RegTimer As Single
    2.  
    3. RegTimer = Timer
    4.  
    5. Do While Timer - RegTimer < 2
    6.  'Wait 2 Sec.
    7. Loop
    8.  
    9. MsgBox "You are too late.. :)"
    That code will have a process utilization of 99% though.
    Using a timer will not.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284
    Originally posted by plenderj


    That code will have a process utilization of 99% though.
    Using a timer will not.
    youre right.. sorry

    Jim.

  6. #6
    Member 110359's Avatar
    Join Date
    Jun 2002
    Location
    Melbourne, Australia
    Posts
    43
    Is the timer on the screen, I mean is there a countdown clock.

    If there s then you can just use a timer with a 1000 interval and have a code of:
    if label1.caption < 10 then
    label1.caption = label1.caption - 1
    end if
    if label1.caption = 0 then
    msgbox, etc.
    end if

    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?

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