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.

DarkBASIC Discussion / game pause mode?

Author
Message
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 5th Jan 2003 16:26
hi i am trying to make my game pause but i don't know how i get a sort of pause screen to come up but how do i get it to pause the character movement while it's paused and how can i get it to unpause?

cloud
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 5th Jan 2003 16:50
oh and i found a programm on darkbasic.com and when i go to download it it's not in english and i can't find anything that tell u to downooad it it is called 3D Map Editor in the showcase part of the db site.

cloud
Kale
21
Years of Service
User Offline
Joined: 8th Sep 2002
Location: United Kingdom
Posted: 5th Jan 2003 17:29
use gosubs!

first place a label at the start of your main loop (inside) then have a label outside the loop to handle the pause screen. gosub to pause when you want to pause then when finished with gosub back to start.

NOTE: this is completely untested, but should work

What the flame does not consume, consumes the flame.
------------------------------------------------------------------------
AMD XP2100+, Geforce4Ti 4400, 512Mb DDR, Abit KX7, WinXP Home
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 5th Jan 2003 23:08
but will that stop the caracter moving.

cloud
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 5th Jan 2003 23:22
You could try stop object x and play object x

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 6th Jan 2003 00:34
dont use gosubs, coz u need to return them. use branch labels

xxxpetratxxx
B. R. W
Dr DooMer
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 6th Jan 2003 00:36
Okay, here's one way you can do it:

While running, your game executes a load of commands within a loop, right? This loop keeps your program confined to within a certain piece of code. Now, you can either break from this loop, to return later, when the pause button is used, or you introduce another loop within the main loop when pause is used. This second loop would just confine your program to an even smaller piece of code, preventing it from running anything else (like player movement, enemy AI, etc) until you've broken from it. Here's psuedo-code:

Start main loop
|
| If paused, start paused loop
| |
| | If not paused, break from paused loop
| |
| End of pause loop
|
| Main commands go here
|
End of main loop

You would probably want to add a sync and a pause screen to the paused loop, just to make it look right.

Hope this helps!

"I am a living, thinking entity who was created in the sea of information."
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 6th Jan 2003 05:55
yup creating a mini do nothing loop is the key

u can even make that loop a function


function Paws()
do
center text screen width()/2 screen height()/2,"Paused"
if escapekey() = 1 then exit
sync
loop
endfunction

Attreid
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 11th Jan 2003 19:52
( yes, I know, this post is old, but it isn't a problem ^^ )

oh and i found a programm on darkbasic.com and when i go to download it it's not in english and i can't find anything that tell u to downooad it it is called 3D Map Editor in the showcase part of the db site.
I know this programm, it's made by Freddix, and it's in french. it's a programm for making 3d maps for db v1, and it work well
ask freddix if he can translate his programm in english

and for your pause, there's an easier way than kale's :


I'm following John, but I'm not john.
Lol, it is funnier in french
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 11th Jan 2003 22:40
thanks

cloud

Login to post a reply

Server time is: 2024-04-18 23:15:13
Your offset time is: 2024-04-18 23:15:13