Gamestudio Links
Zorro Links
Newest Posts
bestwinsite
by winsite3. 05/30/24 04:10
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (TipmyPip), 679 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to create double mouseClick and mouseClick Event for Game #405384
07/30/12 04:51
07/30/12 04:51
Joined: Dec 2009
Posts: 128
China
frankjiang Offline OP
Member
frankjiang  Offline OP
Member

Joined: Dec 2009
Posts: 128
China
How to create double mouseClick and mouseClick Event for Game?
is it possible to this thing?
any good guys have good idea for this topic?any one know?


development 3d game is interesting!
Re: How to create double mouseClick and mouseClick Event for Game [Re: frankjiang] #405387
07/30/12 08:32
07/30/12 08:32
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Code:
int nMouseClickedOnce = 0;
int nMouseClickedTwice = 0;

void mouseClick()
{
   int nWaitTime = 200;
   if (nMouseClickedOnce == 0)
   {
      nMouseClickedOnce = 1;
   }
   else
   {
      nMouseClickedTwice = 1;
   }
   while(nWaitTime > 0)
   {
      nWaitTime -=1;
      wait(1);
   }
   nMouseClickedOnce = 0;
   nMouseClickedTwice = 0;
}

void test()
{
   on_mouse_left = mouseClick;
   if (nMouseClickedTwice)
   {
      printf("Mouse clicked twice");
   }
}



Re: How to create double mouseClick and mouseClick Event for Game [Re: PadMalcom] #405399
07/30/12 10:52
07/30/12 10:52
Joined: Dec 2009
Posts: 128
China
frankjiang Offline OP
Member
frankjiang  Offline OP
Member

Joined: Dec 2009
Posts: 128
China
Thank you for your code, guys!


development 3d game is interesting!
Re: How to create double mouseClick and mouseClick Event for Game [Re: PadMalcom] #405400
07/30/12 10:59
07/30/12 10:59
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
or everything inside a loop

Code:
var nMouseLeft = 0;

while ( 1 )
{
	if ( mouse_left )
	{
		if ( !nMouseLeft )
		{
			nMouseLeft = MC_DOUBLECLICKTIME;
		}
		else if ( nMouseLeft < 0 )
		{
			nMouseLeft *= -1;
			
			printf ( "Double click" );
		}
	}
	else if ( nMouseLeft )
	{
		if ( nMouseLeft < 0 )
		{
			nMouseLeft = minv ( nMouseLeft + time_step, 0 );
			
			if ( !nMouseLeft )
			{
				printf ( "Simgle click" );
			}
		}
		else if ( nMouseLeft == MC_DOUBLECLICKTIME )
		{
			nMouseLeft *= -1;
		}
		else
		{
			nMouseLeft = 0;
		}
	}
	
	wait(1);
}



Salud!


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