Basically, increase the indent whenever you use the following commands and outdent again when you use their counterpart.
Function .. EndFunction
Repeat .. Until/Forever
While .. Wend
For .. Next
Type .. EndType
Method .. EndMethod
Select is a bit funny, but it should look something like this...
If..Then..ElseIf..EndIf is another funny one...
Don't forget that these can all be nested...
Notice that all the For's and If's line up with their respective Next's and EndIf's.
Hope that helps
Function .. EndFunction
Repeat .. Until/Forever
While .. Wend
For .. Next
Type .. EndType
Method .. EndMethod
Select is a bit funny, but it should look something like this...
Select <variable> Case <value1) ' do stuff Case <value2> ' do something else Default ' otherwise do this instead EndSelect
If..Then..ElseIf..EndIf is another funny one...
If <expression> Then ' do this ElseIf <expression2> Then ' do that Else ' do something else EndIf
Don't forget that these can all be nested...
Function CheckCollisions() For b:bullet=EachIn bulletList For a:alien=EachIn alienList If <bullet hits alien> Then score:+100 alienList.Remove(a) a=Null bulletList.Remove(b) b=Null Exit EndIf Next Next FlushMem EndFunction
Notice that all the For's and If's line up with their respective Next's and EndIf's.
Hope that helps