Jay S. wrote:Basically, yes.
- Code: Select all
if(count >= 4)
{
LoadGame("level2");
}
A nice Concise example Jay S. Well said. If I see you helping people again, I think I will give you a point!
A little used, but sometimes useful trick is this alternate way of doing that..
- Code: Select all
if((count+1) > 5)
{
LoadGame("level2");
}
or better yet..
- Code: Select all
if((count-bonus) > 5)
{
LoadGame("level2");
}
Which might be useful for loading the next level, but not taking bonus points into account.
For the most part though, you want to be as complete and concise as possible in an if() statement. Using the equal sign with greater/lesser is a good way to avoid nasty little bugs.