Gamestudio Links
Zorro Links
Newest Posts
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
What are you working on?
by rayp. 11/02/26 13:57
No connection to MT4
by JeyKey II. 10/29/26 09:34
Zorro plugin for Hyperliquid.xyz
by opm. 10/28/26 13:50
Icon "OP"
by JeyKey II. 10/27/26 07:03
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (AndrewAMD, LucasJoshua, 1 invisible), 12,465 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
MaliceTheMaker, Haitao_Ren, JimSimons, julienp, julienper
19248 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 | 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