0002
- Description
- Jumps to a label in the script
- Syntax
- 0002: jump [label]
- jump [label]
- Parameter
- [label]
- The position in the script it will go to, usually identified by a label
This opcode is used in unconditional jumps, which allow the game to continue processing the script starting at the location of the label. In both the Mission Builder and Sanny Builder, you can use the jump keyword instead.
Example
The following example, using Sanny Builder, shows a simple usage of a "jump" out of a while loop to the specified label after pressing button 13 (CAMERA key). The message will change from 0 to 1 after a successful jump.
while true wait 10 ms 01E5: text_1number_highpriority 'NUMBER' 0 10 ms 1 if 00E1: key_pressed 0 13 // camera key then jump @label_goto end end :label_misc // miscellaneous content :label_goto 01E5: text_1number_highpriority 'NUMBER' 1 5000 ms 1
Keywords
jump, goto, label
See also
- 004D, goto if false