I'm going to try and make up for being stupid over the "?" syntax![]()
I don't know if anyone has a long row of if statements, like
If so it's quicker to work out if the value is greater than half the end value and split your statements up that way.PHP Code:if (health==1){
...
} else if (health==2){
...
} else if (health==whatever){
...
}
For example if you want to check if health is equal from any value from 1 to 10 do this:
So if the value is 6 you only have to do 2 conditional checks to find out instead of 6.PHP Code:if (health<6){
...Check from 1 to 5
} else {
...Check from 6 to 10
}
I know it's a common sense thing but it might help someone...
Squize.





Reply With Quote