Making code output slower

Grab your favourite IDE and tinker with the innards of game engines

Making code output slower

Postby BlekksPoncho on Thu Apr 05, 2007 11:57 pm

Hi,

I am making a little text-based game and want to make each line output slower than instantly, as to cause suspense or whatever, for when you are attacking the enemy waiting to see how much HP they havetaken off etc.

Is there a way?

Thanks.
-----------------------
I'm not drunk, I always eat plastic.
User avatar
BlekksPoncho
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Sat Apr 01, 2006 10:48 pm
Location: England - UK

Postby Sauce on Fri Apr 06, 2007 12:09 am

use a timer.

lol i know that is a bit vague but the idea of programming is to generally learn things for yourself, you wont get anywhere if everyone tells you how to do it.

I only just woke up too :P
Image
Blink wrote:Do you watch porn and decide you don't need to have sex because you've seen the ending? :-D

zombie@computer wrote:what retarded countries measure in stones anyway?
or feet? or inches? Your dick is a lot longer in cms
User avatar
Sauce
Senior Member
Senior Member
 
Joined: Sat Nov 26, 2005 4:36 am
Location: Australia

Postby Forceflow on Fri Apr 06, 2007 1:52 am

sleep(milliseconds);
It's dirty, but it will do the trick.
User avatar
Forceflow
1337 p0st3r
1337 p0st3r
 
Joined: Sun Jul 16, 2006 12:13 pm
Location: Belgium

Postby zombie@computer on Fri Apr 06, 2007 7:46 am

once you get to GUI's you can use a timer event, but that wont work much better than sleep() on console proggies, since you still have to keep the thread running.
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Postby BlekksPoncho on Fri Apr 06, 2007 12:19 pm

Kk thanks everyone. I know Sauce I should learn myself so thanks for not spelling it out, but I was looking for a timer function but couldn't find it for without the windows api.

So thanks forceflow and zombie@computer for telling me about the sleep function.
-----------------------
I'm not drunk, I always eat plastic.
User avatar
BlekksPoncho
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Sat Apr 01, 2006 10:48 pm
Location: England - UK

Postby Sauce on Fri Apr 06, 2007 12:43 pm

lol i didnt realise he was making a console app :P
Image
Blink wrote:Do you watch porn and decide you don't need to have sex because you've seen the ending? :-D

zombie@computer wrote:what retarded countries measure in stones anyway?
or feet? or inches? Your dick is a lot longer in cms
User avatar
Sauce
Senior Member
Senior Member
 
Joined: Sat Nov 26, 2005 4:36 am
Location: Australia

Return to Programming

Who is online

Users browsing this forum: No registered users