Page 1 of 1

How to make 2 things happen at once in Qbasic

Posted: Fri Nov 09, 2007 1:13 pm
by tibbalz
I'm pretty decent in Qbasic but I still cannot figure out how to make Qbasic do two things at one like

Code: Select all

locate row, column
print player$
while it does this at the same time

Code: Select all

locate row, column
print badguy$
I wish I could explain myself a little better

Posted: Fri Nov 09, 2007 5:49 pm
by BDZ
Except for some strange sound functions and event-trapping stuff, you cannot have QB "do two things at once." I guess the question I have is why do you need to have it print two things exactly at the same time? Just print one after the other. To the user this will appear instantaneous.

Posted: Fri Nov 09, 2007 6:00 pm
by burger2227
Loops are pretty fast, so you can make it appear to be doing two things at once. The only problem is if a procedure in the loop creates a delay of some kind.

To print both the player and badguy you can print them both in a loop, but you will also have to find the new column and row too. This could be set as a reaction to a players move for instance in an arrow key move, etc.

Ted

Re: How to make 2 things happen at once in Qbasic

Posted: Fri Nov 09, 2007 9:32 pm
by Mac
[quote="tibbalz"]I wish I could explain myself a little better[/quote]

Well, I think you need to try harder.

Explain what problem you are trying to solve.

What kind of game are you working on?

Mac

Posted: Sat Nov 10, 2007 2:55 am
by Nodtveidt
As BDZ stated, just execute them one after the other. They will work so quickly that the player won't even notice that they're not being updated at exactly the same moment in time.

Re: How to make 2 things happen at once in Qbasic

Posted: Sat Nov 10, 2007 5:23 pm
by Mac
[quote="tibbalz"] how to make Qbasic do two things at once[/quote]

Well, your print example was strange, but here is a simple example of moving two missiles at once while prompting the user for input:

http://www.network54.com/Forum/171757/m ... 009940081/

Mac