If any sprite in the specified category is within the bounds of this plan or
the Target plan, and is pressing the specified Trigger, transport it to the
other plan.
Namespace: (Default Namespace)Assembly: Default (in Default.exe) Version: 1.0.0.0
Syntax public virtual int Door(
PlanBase Target,
SpriteCollection Sprites,
SpriteBaseInputBits Trigger
)
Parameters
- Target
- Type: (Default Namespace)PlanBase
Specifies the plan representing the other end of this doorway - Sprites
- Type: (Default Namespace)SpriteCollection
Specifies a category of sprites that can activate this doorway - Trigger
- Type: (Default Namespace)SpriteBaseInputBits
Specifies which input bit on the sprite will cause the
sprite to activate the doorway and be transported to the other end.
Return Value
Type:
Int32If any sprites were transported, the index within the collection of the first
sprite that was transported, otherwise -1
Remarks This function handles both ends of a doorway and will allow a sprite to travel
from this end to the Target plan or vice versa when the conditions are met. In order for
the conditions to be met, the center of the sprite must be within the bounds of this
plan rectangle or the Target plan rectangle, and (all) the specified Trigger input(s) must
be on/pressed, and must not have been in the same state before (this prevents the sprite from
flipping repeatedly between both ends of the doorway). If the conditions are met,
the sprite will be transported such that the bottom center of the sprite will match up
with the opposite plan rectangle's bottom center.
See Also