Timer - generating overflow

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • joec
    New Member
    • Jul 2006
    • 5

    Timer - generating overflow

    I'm writing an arcade game were I need a delay for the man between steps. Also using the keyboard arrows to direct user man. Using delay at 5000 (changeable)
    Dim mark(15000)
    'Sub
    DEALAYMAN:
    TIMER ON: CONST unmark =0, narkit = NOT unmark: start!= TIMER
    num = 0
    For n = 3 to delay STEP 2
    IF NOT mark(n) THEN
    delta = 3 * n
    FOR i = 3 * n to delay STEP delta
    NEXT: num = num + 1
    END IF
    NEXT
    finish! - TIMER: RETURN
    I tried a simpler method
    DELAYMAN: TIMER ON: delay = TIMER + .004
    TM1: dy = TIMER: IF DY < delay THEN GOTO TM1
    RETURN
    This works although .004 is too slow and although I stop pressing the arrown keys the man keeps on running
    Can someone please help?
    Thanks in anticipation.
    joec
  • joec
    New Member
    • Jul 2006
    • 5

    #2
    I am self taught, using visual basic msdos version, with this problem.
    I do have version 6 for windows but finding it dificult to do graphics.
    joec

    Comment

    • sashi
      Recognized Expert Top Contributor
      • Jun 2006
      • 1749

      #3
      Hi Joec,

      in-order to have a better control of graphics in VB6 you need to work along with DirectX.. timer in VB6 is assumed as miliseconds.. remember that my fren.. check out msdn for some example code on using DirectX along with VB6.. good luck my fren..

      Comment

      • joec
        New Member
        • Jul 2006
        • 5

        #4
        Thankyou Sashi, but it is not in VB6 that I need the help it is in visual basic msdos version I am in the middle of a program.
        joec

        Comment

        • iam_clint
          Recognized Expert Top Contributor
          • Jul 2006
          • 1207

          #5
          an overflow means the var probably got to long you need to reset the var after so long.

          Comment

          • joec
            New Member
            • Jul 2006
            • 5

            #6
            Thank you all. I didn't make myself clear. The program executes fine with F5 it's when I try to Make it an exe file that I get "program memory overflow". Sorry to have wasted your time. Regards. joec

            Comment

            Working...