Lasers and Portals are so-called Color-Driven Systems. It means that every Laser or Portal have a Color associated with it.
Colors are:
Laser System controls if a particular Color in On or Off. If Color is On, all Lasers of that Color are enabled. If Color is Off – disabled.
Color can be turned On or Off with a Button of that color. Lasers can work separately of Buttons, but if there is no Button for a particular Laser Color, this Laser can be turned Off only by destroying the Block it is attached to.
Working Laser is a pair of objects placed directly one opposite of the other. One of them is a Receiver, and one is a Transmitter. A single Laser object cannot be turned on.
Every level have an initial Lasers System State set up (if used), so every time level starts, Lasers with Colors set in the level as Turned On, will be enabled by default.
Portals that share the same Color are connected into the chain. Every chain of portals is sorted randomly every time level loads, if the particular sorting order is not set. Some Portals can have a sorting index set, and some not, and in this case the ones with the explicit order will go first, and then all the others sorted randomly.
Player will be transported from one Portal to the next in the list of Portals with the same Color. When player reaches last Portal in the chain, the chain loops.
A single Portal of a specific Color will lead nowhere (will loop to itself).
To trigger a Portal, player must step (or land) on it. After arriving to the destination, player can jump in place to trigger the next teleportation in the chain.