Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
burrbittyburr
23
Years of Service
User Offline
Joined: 19th Sep 2002
Location:
Posted: 4th Oct 2003 10:52 Edited at: 4th Oct 2003 10:53
Hi,
I've made an explosion that goes off when the "P" key is pressed.
The cube is there to drive around with the mouse to see if there's any drop in FPS.
The problem is, I have to run a high frame rate to keep the cube looking right and a low frame rate so the explosion doesn't go by too fast. But every time I activate the explosion the cube stops until the explosion completes. How can I make everything run together smoothly with two different frame rates? Please look over the code and I appreciate any help you can give.

Specs[1 GiG Athlon,Geforce Ti4, 128mb]
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Oct 2003 14:53 Edited at: 4th Oct 2003 14:55
OK...you're pausing your game while the explosion occurs. The Explode subroutine loops until the entire explosion has happened, then you drop back to the main routine and carry on with the rest of the program.

Here's an idea...

Set up 2 global variables called Exploding and Frame. Change this



to this



Change the EXPLODE subroutine...


This will let your explosion happen ALONGSIDE everything else, rather than INSTEAD of everything else.

If you want to slow the explosion down to what your code used to do, you need to add avariable to save the time, and only execute the EXPLODE routine every 125 milliseconds.

Hope this helps. I haven't tested the code so it may not be bang on.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
burrbittyburr
23
Years of Service
User Offline
Joined: 19th Sep 2002
Location:
Posted: 5th Oct 2003 08:25 Edited at: 5th Oct 2003 08:26
Hey BatVink,
First off I want to thank you for your reply.I've been working on this for awhile now and can really use the help.
I made the changes with the code you posted and it worked as you explained.
I think what I'm looking for leans more toward what you said at the bottom

Quote: "you need to add avariable to save the time, and only execute the EXPLODE routine every 125 milliseconds."


Do you think you can show me how to execute the EXPLODE routine every 125 milliseconds?

Thanks

Specs[1 GiG Athlon,Geforce Ti4, 128mb]

Login to post a reply

Server time is: 2026-07-25 07:01:53
Your offset time is: 2026-07-25 07:01:53