Results 1 to 3 of 3

Thread: beginner flow question

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    4

    Question

    Is there a way to pause execution of a procedure to wait for user input? I'm using VB5 to write a basic rpg with 2 human players and 2 computer players. When combat is initiated, I want to LOOP until both humans or both computers are dead. However, my LOOP continues to LOOP giving the computer players endless turns to attack without pausing for player input. Can anyone help me with a command or source code example? I realize this is probably a pretty basic question but I've never used VB for games before.

  2. #2

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    4
    I think I've found a way to do it with timers but if anyone has a better method, I'd still love to hear it.

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134

    Red face

    Use this:

    Option Explicit
    Dim Computer1Turn as boolean
    dim computer2turn as boolean
    dim player1turn as boolean
    dim player2turn as boolean

    sub timer1_timer()
    if computer1turn then
    ...'code here
    end if
    end sub

    just do it for comp2turn, player1turn and player2turn.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

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