Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,435 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Built in a pause in the game #201312
04/08/08 11:22
04/08/08 11:22
Joined: Feb 2008
Posts: 23
BW, Germany
X
xakac Offline OP
Newbie
xakac  Offline OP
Newbie
X

Joined: Feb 2008
Posts: 23
BW, Germany
Hi!
How can i built a pause-function in my game?
I just tried this but it doesn`t work \:\( Can anybody help me, please!

Here is my code:
........
// Pause
function pause(){
wait(1);
freeze_mode = 2;
mouse_mode = 1;
pausenPanel.flags = VISIBLE | OVERLAY;
}

// Play
function weiter(){
wait(1);
pausenPanel.flags &= ~VISIBLE;
mouse_mode = 0;
freeze_mode = 0;
}
......
on_p = pause(); // Short-Key to get pause
......

Last edited by xakac; 04/08/08 11:23.
Re: Built in a pause in the game [Re: xakac] #201319
04/08/08 11:52
04/08/08 11:52
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
By writing on_p = pause(); you assign the return value of the function pause to on_p. What you originally wanted to do is assigning the function pause to on_p. Simply ommit the brackets like in "on_p = pause;" and you should be fine. Ensure theassignment happens inside a function, e.g. in your main function.


Always learn from history, to be sure you make the same mistakes again...
Re: Built in a pause in the game [Re: Uhrwerk] #201340
04/08/08 13:05
04/08/08 13:05
Joined: Feb 2008
Posts: 23
BW, Germany
X
xakac Offline OP
Newbie
xakac  Offline OP
Newbie
X

Joined: Feb 2008
Posts: 23
BW, Germany
OK Thanks!
I made it in this way:

function spielStarten(){
...
on_p = pause; // Short-Key to get pause
}

Now, if i press "p", the game stops, it is OK.
But i cannot return to the game again \:\( and i cannot press buttons on the panel that is viewed by the function pause()...

Re: Built in a pause in the game [Re: xakac] #201342
04/08/08 13:29
04/08/08 13:29
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl

 Code:
function pause()
{
	if(freeze_mode == 0)
	{
		freeze_mode = 2;
	}
	else
	{
		freeze_mode = 0;
	}
}

function main()
{
	on_p = pause;
...



"empty"

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1