help with mouse clicks

Game Editor comments and discussion.

Postby DocRabbit » Thu Jul 12, 2007 12:49 am

The order problem could be prevented by using either of the following:
Code: Select all
if(variable==0)
{
variable=1;
//insert other code here
}
else if(variable==1)
{
variable=2;
//insert other code here
}
...
else
{
//default code here
}


Or the switch function
Code: Select all
switch(variable)
{
case 0:
variable=1;
//other code here
break;
case 1:
variable=2;
//other code here
break;
...
default:
//default code here
}

User avatar
DocRabbit
 
Posts: 114
Joined: Fri Oct 27, 2006 2:56 am
Score: 10 Give a positive score

Postby DocRabbit » Thu Jul 12, 2007 12:57 am

The order problem could be prevented by using either of the following:
Code: Select all
if(variable==0)
{
variable=1;
//insert other code here
}
else if(variable==1)
{
variable=2;
//insert other code here
}
...
else
{
//default code here
}


Or the switch function
Code: Select all
switch(variable)
{
case 0:
variable=1;
//other code here
break;
case 1:
variable=2;
//other code here
break;
...
default:
//default code here
}

User avatar
DocRabbit
 
Posts: 114
Joined: Fri Oct 27, 2006 2:56 am
Score: 10 Give a positive score

Previous

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron