Shift
| Shift | |||||||||||||||||||||
| |||||||||||||||||||||
The Shift is a gimmick in the classic Mega Man series, first appearing in Dust Man's stage in Mega Man 4. It allows part of a stage to move within a section, emulating areas such as the rising and falling submarine in Blizzard Man's stage, or the crushers in Dust Man and Mercury's stages.
Shift was first available as a devkit gimmick in Make a Good Mega Man Level 2 (under the name Vertical Shift), but no entry stages used it. It was, however, used in the Wily stage Water Ducts, as well as the Tier X stage Hardcore Parkour.
In the Megamix Engine, Vertical Shift was upgraded into a more versatile object capable of moving in more directions.
Behavior
When placed and stretched over a collection of tiles, a Shift object will convert all solid collision objects (excluding ladders and spikes) beneath it into movable entities, while manually moving water. It will them move them according to the specifications in its creation code (detailed below), with any tiles beneath it similarly moving. In Make a Good Mega Man Level 2, rather than setting its ending position in creation code, it will stop and backtrack when touching a separate stopper icon. Any entities covered by a Shift object will also be moved, though only if their blockCollision value equals 0 (otherwise, only their spawn coordinates will be affected). Although spikes cannot be shifted, one can recreate them by placing down objSolidEntity objects and giving them a high contactDamage value in creation code.
Shift has a high number of creation code variables:
- posX = Sets the coordinates for the object's horizontal movement relative to the object's top-left corner. Using arrays, the starting position can be set to posX[0] = 256, and the ending position to posX[1] = 512. By specifying only the starting coordinate, the object will not move horizontally.
- posY = Sets the coordinates for the object's vertical movement relative to the object's top-left corner. Like posX, it uses arrays to set its start point and its end point.
- posT = Defines the relative time coordinate for each location, thereby controlling the speed of the object. Like posX and posY, it uses arrays, and must start with a value of 0 and increase (therefore, to give a consistent speed to the Shift object, instead of posT[1] = 60 followed by posT[2] = 60, the user must make posT[2]'s value equal to 120). If an additional posT value isn't specified, by default a value one greater than posT[1] will be assigned, potentially causing the object to make rapid jumps.
- isCyclic = Set to true by default, but if set to false, the object will stop upon reaching its ending position and never move again.
- secX and secY = If defined, the Shift object will only exist in the section specified by the respective coordinates. Otherwise, it uses posX and posY's values.
- tileLayer = The tile layer the object looks for when moving tiles. Any tiles on the specified layer (1000000 by default) that the object covers will be moved with the object.