PDA

Click to See Complete Forum and Search --> : beginner flow question


etjohn
May 18th, 2000, 04:46 AM
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.

etjohn
May 18th, 2000, 09:10 AM
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.

Sastraxi
Jun 18th, 2000, 12:55 AM
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.