Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AbrahamR, wdlmaster, 7th_zorro, dr_panther, 1 invisible), 764 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
need a bit of help! #316874
03/27/10 13:49
03/27/10 13:49
Joined: Feb 2010
Posts: 457
Norfolk,England
mikaldinho Offline OP
Senior Member
mikaldinho  Offline OP
Senior Member

Joined: Feb 2010
Posts: 457
Norfolk,England
how would you make a button start the game if it is pressed?

is it a function?

Re: need a bit of help! [Re: mikaldinho] #316877
03/27/10 14:09
03/27/10 14:09
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Yes you can define a function, and then pass it as the 'FunctionClick' parameter in your button defintion.

If you want to suspend the game from running until the button is pressed, you can use a simple variable and a while loop in the main function...
Code:
var start_game = 0;

function main()
{
while(start_game==0){wait(1);}
...
// start game bla bla
}


Then your function attached to the button will simply set this variable to 1.

Last edited by DJBMASTER; 03/27/10 16:21.
Re: need a bit of help! [Re: DJBMASTER] #316896
03/27/10 15:54
03/27/10 15:54
Joined: Feb 2010
Posts: 457
Norfolk,England
mikaldinho Offline OP
Senior Member
mikaldinho  Offline OP
Senior Member

Joined: Feb 2010
Posts: 457
Norfolk,England
thanks DJBMASTER! that will help me out with my project.


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

Gamestudio download | chip programmers | 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