Menu
IDC40 - AND / OR
Nested IF
Sometimes you need to ask two questions, and if the answer to both of those questions are true, then you respond. This can be accomplished by asking one question, and if the answer to that is true, then you respond by asking the second question. An IF-statement that is inside another IF-statement is called a "nested-IF"
Logical AND
Instead of a nested-IF, it is possible to join two questions into one question by using the word AND...
Logical OR
Sometimes you need to respond the same way to a variety of different cases. For instance, an object that must bounce off the left and right sides of the screen may ask a question like this...
Both AND and OR
Sometimes you may need to combine the AND with an OR for an even more complex question. For instance, if there are two aliens and the consequence is the same for colliding with either one, then we need to ask if the X and Y coordinates of the player are the same as one alien OR if the X and Y coordinates of the player are the same as the other alien...